If you don't want a console, declare a winmain. This is the non-unicode version
#include <windows.h>
#include <iostream>
#include <cstdio>
int main (int, char**);
// If we just start with main, we will always get a console window
int WINAPI WinMain (
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow
)
{
int argc = __argc;
char** argv = __argv;
#ifdef DEBUG
// If we are running in debug mode, open a console window
AllocConsole();
freopen("conin$", "r", stdin);
freopen("conout$", "w", stdout);
freopen("conout$", "w", stderr);
#endif
return main (argc, argv);
}
int main (
int argc,
char** argv
)
{
MessageBox(NULL, "Whoo hoo", "It Works!!!", MB_OK);
return 0;
}