Getting program to run in background

How would I get a program to run in the background without running in any console or window?
example:
1
2
3
4
5
6
7
8
#include <windows.h>

int _stdcall WinMain(HINSTANCE, HINSTANCE, char*, int){
	MessageBox(0, "It's like I'm not here!", "Me!", MB_OK);
	while(!GetAsyncKeyState(VK_ESCAPE));
	MessageBox(0, "was it awesome?", "Me!", MB_YESNO);
	return 0;
}

I'm not sure if this is the best way, as I have never found any need to do this.
Last edited on
how would I be able to use that in a console application?
I know i know it sounds weird to talk about a console application that doesn't use a console, but i'm not as familiar with the windows libraries enough.
how would I be able to use that in a console application?


You wouldn't. You said you didn't want the console.
well i meant basically by still calling main() as opposed to WinMain()
I don't think there is a simple way. What difference does it make though? Without a console you wont be able to use cin/cout, but everything else is fine.
Topic archived. No new replies allowed.