Skip to main content
GameDev.net gamedev.net
🔒 Locked

Refresh Windows desktop

Started by firstelder_d Aug 25, 2011 at 10:14 PM 3 replies 1.7k views
Original Post
firstelder_d
firstelder_d
Hi,

When I change resolution from a large res to a small one, the game in the original res is still seen because the other windows haven't repainted themselves.

Everywhere I search says to use InvalidateRect. I'm using InvalidateRect(NULL, NULL, TRUE) Which I know windows doesn't recommend. But it doesn't always work, there's always certain places that don't update. For example Firefox, and Visual Studio. I have a feeling its because these programs are ignoring whatever windows message is being sent. Does anyone know of a way to fix this?

Thanks for the help
firstelder_d
firstelder_d
I'm using DirectX so Reset() and SetWindowPos() to change the window size. Also I forgot to mention this is in windowed mode.
ApochPiQ
ApochPiQ
For what it's worth, I've noticed that pretty much every program that uses DirectX rendering causes refresh artifacts to form on Visual Studio's UI. It seems like no matter what happens, VS just doesn't like to redraw as often as it is supposed to.

I don't know if there is a fix for this problem that you could build into your own code, but at least it should be comforting to know that you're not the only one who trips these issues. I would guess (although I may well be wrong!) that the fault is with VS/whatever else isn't refreshing correctly, and not in your program itself.


[edit] Actually... what version of Windows are you running? You might be running afoul of DWM's caching mechanisms.
firstelder_d
firstelder_d
I'm using XP, I'll see if I can try it on 7. I'm pretty I've seen this on other programs, so it makes sense that there's nothing I can do. Thanks for the help.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.