Jump to content
  • Advertisement
Sign in to follow this  

DefWindowProc Freezes

This topic is 4964 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!