Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

stranger4u

Game crashes when I lock the computer

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

I''m running a 2d windowed game and whenever I lock my computer (using the windows key + l or ctrl+alt+del) the game crashes. The problem seems to be withing the ConvertGDIColor of ddutil.cpp in the line if (dwGDIColor != CLR_INVALID && m_pdds->GetDC(&hdc) == DD_OK) the m_pdds pointer has the value 0xfeeefeee. that seems to be the problem. but why? because i locked the computer the game can''t draw to the screen.. alright. but why does it crash? what''s going on there? and how do i prevent it? how can i stop drawing when my game is not on the screen? using WM_ACTIVATE doesn''t help. are there any other messages i should use or is there another way to prevent the game from crashing? i got no idea why this happens. it''s running fine in the background (minimized or behind other applications) so why does it crash when i lock the computer?

Share this post


Link to post
Share on other sites
Advertisement
I dont know an exact answer to your question, but try WM_ACTIVATEAPP:




case WM_ACTIVATEAPP:
bool fActive;
fActive = (bool)LOWORD(wparam); // activation flag
if (mysub)
{
if (fActive == FALSE)
{
mysub->p_bFocused = false;
}
else
{
mysub->OnReset();
mysub->p_bFocused = true;
}
}
break;



Then in your rendering code if the p_bFocused = false don''t draw.

(those are my variables and my code so you would have to change names, etc)

Share this post


Link to post
Share on other sites

  • 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!