Instead of running WM_QUIT, use a flag to quit the loop. This fixes
problems when a console window is opened.
This commit is contained in:
@@ -38,8 +38,9 @@ MessageWindow::~MessageWindow()
|
||||
|
||||
void MessageWindow::Run()
|
||||
{
|
||||
/* Process messages until we get WM_QUIT. */
|
||||
while( 1 )
|
||||
/* Process messages until StopRunning is called. */
|
||||
m_bDone = false;
|
||||
while( !m_bDone )
|
||||
{
|
||||
MSG msg;
|
||||
int iRet = GetMessage( &msg, m_hWnd, 0, 0 );
|
||||
@@ -50,6 +51,11 @@ void MessageWindow::Run()
|
||||
}
|
||||
}
|
||||
|
||||
void MessageWindow::StopRunning()
|
||||
{
|
||||
m_bDone = true;
|
||||
}
|
||||
|
||||
LRESULT CALLBACK MessageWindow::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
|
||||
{
|
||||
MessageWindow *pThis = (MessageWindow *) GetProp( hWnd, "MessageWindow" );
|
||||
|
||||
Reference in New Issue
Block a user