   Game crashes when I lock the computer
  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 lineif (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?  
  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)  ;  that doesn''t work either  ;  Are you dealing with lost surfaces? What does your code do, if you can''t recreate them?  ;  good question...i guess i should check what happens if i can''t recreate them.   