how do you make a console program that can only be seen under the processes window in the task manager?
Printable View
how do you make a console program that can only be seen under the processes window in the task manager?
As far as I know, all console programs open up a console window. If you don't want a console to pop up, get into windows programming.
Here's a rather hackish solution....
//edit: Here's one that'll work no matter where your program is located (the title bar usually displays your program's location)Code:#include <stdio.h>
#include <windows.h>
#include <conio.h>
int main(void)
{
HWND hConsole = FindWindow(NULL, "title of my window");
ShowWindow(hConsole, SW_HIDE);
getch();
return 0;
}
Code:#include <stdio.h>
#include <windows.h>
#include <conio.h>
int main(int argc, char *argv[])
{
char tmp[50];
sprintf(tmp, "\"%s\"", argv[0]);
HWND hConsole = FindWindow(NULL, tmp);
ShowWindow(hConsole, SW_HIDE);
getch();
return 0;
}