Created
February 7, 2022 12:44
-
-
Save zimnyaa/1101d7c2dc4474c9e022accf6dcc4aad to your computer and use it in GitHub Desktop.
Hiding windows in a current process (code snippet from xyrella)
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
when defined hidewindow: | |
proc wndenumcallback(windowHandle: HWND, param: LPARAM): WINBOOL {.stdcall.} = | |
var process_id: DwORD | |
var wanted = cast[ptr DWORD](param) | |
GetWindowThreadProcessId(windowHandle, &process_id); | |
if process_id == wanted[]: | |
ShowWindow(windowHandle, SW_FORCEMINIMIZE) | |
return true | |
proc hidewindow() = | |
var processID = GetCurrentProcessId(); | |
EnumWindows(wndenumcallback, cast[LPARAM](addr processID)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment