Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void EndTransparentWindow()
- {
- #if !UNITY_EDITOR // You really don't want to enable this in the editor..
- int fWidth = Screen.width;
- int fHeight = Screen.height;
- var margins = new MARGINS() { cxLeftWidth = -1 };
- var hwnd = GetActiveWindow();
- SetWindowLong(hwnd, GWL_STYLE, WS_POPUP | WS_VISIBLE);
- // Transparent windows with click through
- SetWindowLong(hwnd, -20, 524288);//GWL_EXSTYLE=-20; WS_EX_LAYERED=524288=&h80000, WS_EX_TRANSPARENT=32=0x00000020L
- SetLayeredWindowAttributes(hwnd, 255, 255, 0);// Transparency=51=20%, LWA_ALPHA=2
- SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, fWidth, fHeight, 32); //SWP_FRAMECHANGED = 0x0020 (32); //SWP_SHOWWINDOW = 0x0040 (64)
- // DwmExtendFrameIntoClientArea(hwnd, ref margins);
- Screen.SetResolution(1920, 1080, true);
- #endif
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement