-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hide console in Windows if not launched from CLI
- Loading branch information
Showing
5 changed files
with
33 additions
and
2 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
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,17 @@ | ||
#include "win32_tweaks.h" | ||
#include <windowsesque.h> | ||
|
||
void | ||
win32_tweaks_hide_console(void) { | ||
HMODULE kernel32 = LoadLibraryA("kernel32.dll"); | ||
if (kernel32 == NULL) { return; } | ||
|
||
DWORD WINAPI (*GetConsoleProcessList)(LPDWORD lpdwProcessList, DWORD dwProcessCount) = GetProcAddress(kernel32, "GetConsoleProcessList"); | ||
if (GetConsoleProcessList == NULL) { return; } | ||
|
||
DWORD pids[2]; | ||
DWORD num_procs = GetConsoleProcessList(pids, 2); | ||
if (num_procs <= 1) { | ||
FreeConsole(); | ||
} | ||
} |
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,7 @@ | ||
#ifndef WIN32_TWEAKS | ||
#define WIN32_TWEAKS | ||
|
||
void | ||
win32_tweaks_hide_console(void); | ||
|
||
#endif |