Sign in to follow this  

DefWindowProc Freezes

Recommended Posts

I tried looking up some other threads in this forum, but they didnt seem to help. My WndProc: ------------------ LRESULT CALLBACK CWin32Window::WndProc(HWND hWindow, UINT uMsg, WPARAM wParam, LPARAM lParam) { switch (uMsg) { case WM_PAINT: //ValidateRect(hWindow, NULL); //return 0; break; case WM_DESTROY: m_bWindowClosed = TRUE; break; default: return DefWindowProc(hWindow, uMsg, wParam, lParam); } return DefWindowProc(hWindow, uMsg, wParam, lParam); } ------------------- I'm having issues with WM_PAINT messages spamming my PeekMessage loop (which I didnt have until just recently). Now they just hang the DefWindowProc function to death, and I get an unresponsive window. Peek Message Loop: ------------------- while(bRun) { bGotMsg = ( PeekMessage( &msg, NULL, 0U, 0U, PM_REMOVE ) != 0 ); if( bGotMsg ) { // Translate and dispatch the message if( 0 == TranslateAccelerator( mainWnd->getWindowHandle(), NULL, &msg ) ) { TranslateMessage( &msg ); DispatchMessage( &msg ); } if (mainWnd->isWindowClosed()) bRun = false; } else { render()... etc... } } --------------- Thanks for any help anyone can give me on this :) I also tried handling the WM_PAINT message myself in WndProc using the BeginPaint / EndPaint functions and ValidateRect. Using either combination results in the hung window so I'm guessing that the DefWindowProc function hangs when It executes those functions.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this