Minimizing

Started by
2 comments, last by Bliz23 18 years, 8 months ago
So I want my application to minimize, but its not working right. Two things will happen, the first is when its windowed and i define the window style as "WS_MINIMIZE | WS_SYSMENU". It will minimize fine, but once its minimized the computer seems to slow up drastically! I ran it with music in another app. The music worked fine untill i minimized it, when it started acting like a broken record. But after i finally get it back maximized, everything seems to work fine, even the music. This works not just when minimizing but when the program is not the one on top. The other case is when the application is in full screen. I use the window style of "WS_POPUP". It starts out fine. Then i hit the windows logo to minimize it and it still works fine with only like a split second delay. Then i go back to maximize it and when its back to full screen, nothing of the program works, it goes to just like i created an empty window, all white. Also if i changed the resolution on the fullscreen app to something else, when i maximize it, it is just a white 800 by 600 screen. If someone could help me out to like pause the app when its a minimized window so that it doesn't slow the computer down, or if someone could help me be able to maximize the window correctly in fullscreen mode. Any help will be greatly appreciated. Thanks.
Advertisement
Sometimes when going back to fullscreen you don't restore some of your variables.. It really depends on your game loop and how you have it structured, I had that problem a year or two back with one of my games, I was initializing objects in my openGL init routine, and when it was maximized, it called that again, overwriting all the data that had built up.

That may help a bit, sorry I can't help with your other problems!
With function TestCooperativeLevel you can check if your program can still draw to the device...

So at someting like the followinf to your Render-Method:

HRESULT hResult = d3ddevice->TestCooperativeLevel();
if( hResult == D3DERR_DEVICELOST )
return;

I hope this, what you were seeking for. Good Luck!
hmmm, i haven't tried restoring the variables yet, but i'll do that. Also the TestCooperativeLevel seemed to return OK, but its still black. O well, i'll just disable minimizing altogether to get rid of my problem. But i did fix the slowdown for switching apps when in windowed mode, i just "paused" the game by not rendering and updating stuff when it was the top application. Thanks for the help.

This topic is closed to new replies.

Advertisement