Jump to content
  • Advertisement
Sign in to follow this  

Window focus problems

This topic is 4946 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

Hi! I've got this nasty problem with a number of my programs. I set up a message loop that uses PeekMessage, and in the free time it calls Game->Update(). Game->Update check if the required amount of time has passed and either makes an update of the screen, or returns. Also, there is a variable updating, which is set to 0 when the window is minimized etc. - so that it "turns off" updating. Now, when the program is running and i click in a different window, sometimes( not always) rather than just loosing focus, the game "sort of" makes one additional update. The result is that although the focus moves to the proper window and my game stops updating, the window area of the app i switched to is overwritten by the game image. Debugging seems to suggest, that the order of events is this: 1. The second app gets a WM_ACTIVATEAPP/WM_ACTIVE AND WM_PAINT 2. My app makes an update 3. My app gets a message telling it to deactivate( i tried WM_ACTIVE, WM_ACTIVATEAPP, WM_KILLFOCUS/WM_SETFOCUS, WM_ENABLE and WM_SHOWWINDOW - all methods produce the same effect). Anyone have an idea about what to do with this?

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!