I want to know how to hide a console window when it starts.
It\'s for a keylogger program, but it\'s not my intention to hack someone. It\'s for a littl
#include
ShowWindow(GetConsoleWindow(), SW_HIDE); //SW_RESTORE to bring back
This will return a windows handle (HWND) to ShowWindow() which will in turn hide it. This solution is for windows systems only.
This is the correct answer to the question, even if its not marked as it.
edit: A possible solution/hack could be to set (in visual studio) Linker->System->SubSystem to "Windows (/SUBSYSTEM:WINDOWS)" instead of "Console (/SUBSYSTEM:CONSOLE)". This is probably not optimal however.