-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
55 additions
and
22 deletions.
There are no files selected for viewing
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,49 @@ | ||
using System; | ||
using System.Text; | ||
using System.Runtime.InteropServices; | ||
|
||
|
||
namespace EDMCOverlay | ||
{ | ||
[StructLayout(LayoutKind.Sequential)] | ||
public struct RECT | ||
{ | ||
public int Left; | ||
public int Top; | ||
public int Right; | ||
public int Bottom; | ||
} | ||
|
||
|
||
public class WindowUtils | ||
{ | ||
public const Int32 WS_EX_LAYERED = 0x00080000; | ||
public const Int32 WS_EX_TRANSPARENT = 0x00000020; | ||
public const Int32 WS_EX_NOACTIVATE = 0x08000000; | ||
|
||
public const int GWL_EXSTYLE = -20; | ||
|
||
public const int DWMWA_TRANSITIONS_FORCEDISABLED = 3; | ||
|
||
[DllImport("dwmapi.dll")] | ||
public static extern UInt32 DwmSetWindowAttribute(IntPtr hWnd, UInt32 attr, ref int value, UInt32 attrLen); | ||
|
||
[DllImport("user32.dll")] | ||
public static extern Int32 SetWindowLong(IntPtr hWnd, int nIndex, Int32 dwNewLong); | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
public static extern Int32 GetWindowLong(IntPtr hWnd, int nIndex); | ||
|
||
[DllImport("user32.dll", SetLastError = true)] | ||
[return: MarshalAs(UnmanagedType.Bool)] | ||
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT lpRect); | ||
|
||
|
||
[DllImport("user32.dll")] | ||
public static extern IntPtr GetForegroundWindow(); | ||
|
||
[DllImport("user32.dll")] | ||
public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); | ||
} | ||
|
||
} |
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