Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

C 

Hide Console Window (No Fast Console Open/Close)

So I've tried a bunch of ways to hide the window.

IE:
Spoiler (Click to View)
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...
[Image: chain.png]
(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.
[Image: chain.png]
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).
x86 asm - ISO & ANSI C
what have you tried?
I'm using just FreeConsole(); fast and no code :P


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by PitbullT0rJun 15, 2021 03:39 AM 5 312 Jun 15, 2021 03:39 AM
Last Post: Mistercoenkel
[C#] by /{evin Mitnic/{Oct 2, 2020 05:56 AM 0 149 Oct 2, 2020 05:56 AM
Last Post: /{evin Mitnic/{
[Python] by zioncorpDec 28, 2018 11:13 AM 5 221 Dec 28, 2018 11:13 AM
Last Post: LouisXV