Article ID: 106385
Article Last Modified on 7/11/2005
int WinMain( hInstance, hPrevInstance, lpszCmdLine, nCmdShow ) HINSTANCE hInstance; /* Handle of current instance */ HINSTANCE hPrevInstance; /* Handle of previous instance */ LPSTR lpszCmdLine; /* Address of command line */ int nCmdShow; /* Show state of window */However, under Win32, hPrevInstance is documented to always be NULL. The reason is that each application runs in its own address space and may have the same ID as another application.
if( !hPrevInstance )
if( !InitApplication(hInstance) )
return FALSE;
Under Win16, window classes only are registered by the first instance of
an application. Consequently, if hPrevInstance is not NULL, then the window
classes have already been registered and InitApplication() is not called.
Additional query words: prevent CreateMutex
Keywords: kbhowto KB106385