DO NOT DEAL WITH THIS MEMBER
Mar 10, 2014 09:56 PM
(This post was last modified: Mar 10, 2014 09:58 PM by Bandors Jr..)
So I've tried a bunch of ways to hide the window.
IE:
Code HWND hWnd = GetConsoleWindow();
ShowWindow( hWnd, SW_HIDE );
etc etc. But they all flash the console before closing it.
Then I tried MoveWindow()
Code int main()
{
MoveWindow( GetConsoleWindow(), 0, 0, 0, 0, TRUE);
// do whatever code bla bla bla
return 0;
}
I'm very new to C++ and this was just for my Download&Execute project but it was a bitch having the console flash, not to mention a bit suspicious. More of you experience users won't need this, but ya.
Why not just use WinMain as the entry point? Much easier...
DO NOT DEAL WITH THIS MEMBER
(Mar 10, 2014 10:31 PM)Sajuuk Wrote: Why not just use WinMain as the entry point? Much easier...
IDK, I'm new and this is what worked for me :P
Assuming you use visual studio....
The easiest way to accomplish this is create a new project in visual studio, as a console, and in creation options, make it a win32 project, and tick empty project. Then add your main.cpp and add a winmain for an entry point, in lieu of int main(), like you would do with a console..
This will create a completely hidden (console window only) application with no window flash. This can be used for background processes, key loggers, stubs etc.
Or just set subsystem to windows and
#pragma comment(linker,"/ENTRY:main")
RtlCreateIrlObjectA
(Mar 11, 2014 06:09 AM)jessman420 Wrote: Assuming you use visual studio....
The easiest way to accomplish this is create a new project in visual studio, as a console, and in creation options, make it a win32 project, and tick empty project. Then add your main.cpp and add a winmain for an entry point, in lieu of int main(), like you would do with a console..
This will create a completely hidden (console window only) application with no window flash. This can be used for background processes, key loggers, stubs etc.
I use Code::Blocks and virtually do the same thing.
Additionally, you can prevent your hwnd from being enumerated by a message-only window, which will still allow you to have a message loop (use timers & whatnot).
I'm using just FreeConsole(); fast and no code :P
|