guiThread = new cGuiThread; guiThread->start();
cGuiThread guiThread( lpCmdLine ); guiThread.start();
int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ){	appInstance = hInstance;	// Try to load riched20.dll	HMODULE hRiched = LoadLibrary( "riched20.dll" );	if( hRiched == 0 )	{		MessageBox( 0, "The riched20.dll library could not be found on your system.\nPlease install Microsoft Internet Explorer 4.0 or later.", "Riched missing", MB_OK|MB_ICONERROR );		return 1;	}	// Create the WindowClass	WNDCLASS wpClass;	ZeroMemory( &wpClass, sizeof( WNDCLASS ) );	wpClass.hInstance = hInstance;	wpClass.lpfnWndProc = wpWindowProc;	wpClass.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON2 ) );	wpClass.hbrBackground = GetSysColorBrush( COLOR_BTNFACE );	wpClass.lpszClassName = WOLFPACK_CLASS;	wpClass.style = CS_DBLCLKS | CS_VREDRAW | CS_HREDRAW;		if( !RegisterClass( &wpClass ) )	{		MessageBox( 0, "Couldn't register Window Class.", "Window Class", MB_OK|MB_ICONERROR );		return 1;	}	// Create the Window itself	mainWindow = CreateWindow( WOLFPACK_CLASS, "Wolfpack", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, NULL, 0, hInstance, NULL );	if( mainWindow == 0 )	{		MessageBox( 0, QString( "Couldn't create the window: " + getErrorString() ).latin1(), "Wolfpack", MB_OK|MB_ICONERROR );		return 1;	}	ShowWindow( mainWindow, SW_NORMAL );	guiThread = new cGuiThread;	guiThread->start();	MSG msg;	while( GetMessage( &msg, mainWindow, 0, 0 ) > 0 )	{		TranslateMessage( &msg );		DispatchMessage( &msg );	}	keeprun = 0; // We quit, so let's quit the server too	guiThread->wait();	delete guiThread;	return 0;}