Jump to content
  • Advertisement
Sign in to follow this  

GDI+ causing whole XP desktop to redraw

This topic is 3260 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 seek wisdom on a problem that's been driving me crazy for the past week. I use GDI+ to draw the UI of a game I am writing in C++. Everything seemed to be fine until I witnessed and subsequently got multiple reports of whole desktop redraws when users switch between the windows of my game. All the icons and windows (those of other apps too) on the desktop flicker 2-3 times. There is no clear pattern as to when this will happen. You just have to keep activating different windows for a while and boom, whole desktop redraw. I double-checked to make sure that I'm not using HDC 0 or passing NULL rect to InvalidateRect or ValidateRect using the debugger with no luck. This would have been to easy. This was definitely not happening when I was using GDI. The only difference I can see between my app and all the other gdi+ apps I looked at is that in my game the focus follow the mouse. That is when you move the mouse between windows of my game I activate them but do not let them come to the foreground using the SWP_NOZORDER flag. Other than that everything else is pretty basic. Spy++ showed that my app is getting multiple WM_ACTIVATE message when the problem occurs (FALSE-TRUE-FALSE). Any idea what could be causing this ? What should I investigate next ? I'm open to any debugging ideas coming my way, I've exhausted all of mine... ! Fizban77

Share this post

Link to post
Share on other sites

I had this problem with GDI+ (and I've noticed the same thing happen with
WinAmp v5.541)... never found what the actual case was :-(

However, in my case the rendered result (sort of an animation) ended up in
a single GDI+ Bitmap which was output to a rectangle in a dialog...
so I just converted the GDI+ bitmap into an old-style GDI bitmap and
displayed that. Never got the problem again.

Hope that helps

Tony Wilk

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!