Sign in to follow this  

Game exiting when screensaver/user screen appears...

Recommended Posts

Modena360    122
Hey guys, I'm having a problem where by my game will exit immediately when a user returns from the windows xp login screen that appears after a screensaver has come up. I'm using DirectX9 in a window, the problem occurs when say somebody leaves the game, the screensaver will appear after a few minutes, then I'll move the mouse, login again, and I'll see my game's window going grey (i.e. not redrawing), and then simply exiting immediately. Any ideas? I've been looking for a fix for months, without any luck... Modena360

Share this post

Link to post
Share on other sites
Toolmaker    967
When the screensaves becomes active, your Direct3D device will be LOST(Same happens with ALT+TAB).

You have to catch the DeviceReset/Lost events and re-acquire the device before rendering again. Consult the DirectX API documentation on how to handle the DeviceLost event.


Share this post

Link to post
Share on other sites
twkr    162
you could also disable the screen saver when then game starts and re-enable it when the game ends.

void ScreenSaver_SetEnabled(bool value)
::SystemParametersInfo(SPI_SETSCREENSAVEACTIVE, value, 0, 0);
::SystemParametersInfo(SPI_SETLOWPOWERACTIVE, value, 0, 0);
::SystemParametersInfo(SPI_SETPOWEROFFACTIVE, value, 0, 0);

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