Here is my code:
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { MainThread(); OutputDebugString("message 1"); ExitProcess(0); OutputDebugString("message 2"); return 0; }
There is a message in debug window "message 1", there is no message "message 2" and my process keeps running in task manager.