-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix drawing, window state and mouse leaving bugs
- Loading branch information
Showing
6 changed files
with
55 additions
and
9 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Runtime.InteropServices; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace NoFences.Win32 | ||
{ | ||
public class DesktopUtil | ||
{ | ||
[DllImport("user32.dll", SetLastError = true)] | ||
static extern int SetWindowLong(IntPtr hWnd, int nIndex, IntPtr dwNewLong); | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
static extern IntPtr FindWindow(string lpWindowClass, string lpWindowName); | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string className, string windowTitle); | ||
|
||
|
||
const int GWL_HWNDPARENT = -8; | ||
|
||
|
||
public static void GlueToDesktop(IntPtr handle) | ||
{ | ||
IntPtr hprog = FindWindowEx(FindWindowEx(FindWindow("Progman", "Program Manager"), IntPtr.Zero, "SHELLDLL_DefView", ""), IntPtr.Zero, "SysListView32", "FolderView"); | ||
|
||
SetWindowLong(handle, GWL_HWNDPARENT, hprog); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters