hidding DOS window

Questions about programming languages and debugging
Post Reply
User avatar
meco
Newbie
Newbie
Posts: 1
Joined: 12 Dec 2005, 17:00
15

hidding DOS window

Post by meco »

Hi guys, could someone help me how i could hide the DOS window when executing a program im progrmming in C.
Thanks

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11608
Joined: 06 Apr 2005, 16:00
16
Location: The zone.
Contact:

Post by bad_brain »

If you never want the console to be displayed at all, why use a console program? Create a Win32 program, and simply don't create any windows or end the program. Eg:

#include <windows.h>

int WINAPI WinMain(HINSTANCE,HINSTANCE,LPSTR,int)
{
do
{} while(1);

return 0;
}

When the program is run, nothing will show up on the screen, and you will only be able to end it through the task manager. If you actually do want a console to which you can output text, it's possible to spawn a console through a Win32 program. Have a look at AllocConsole

I´m not into C, but I´ve found this in a C-coder´s board, I hope it helps... :wink:

Post Reply