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
Hiding a console window at startup is not really possible in your code because the executable is run by the operating system with specific settings. That's why the console window is displayed for a very short time at startup when you use for example FreeConsole();
To really hide the window at startup, you have to add a special option to you compiler. If you use gcc on Windows (MinGW) you can just add -mwindows
as compiler option in your makefile and there will be absolutely no window or "flash".
I don't know about VisualStudio or whatever you use at the moment, but changing the way your IDE compiles you code is the way to go instead of coding workarounds in C++.
In my view, this approach is better than using WinMain
because it works reliably and you don't make your C++ Code platform dependent.