Attempting to save current screen
Here is the code that I can not get to work to save the current screen and to restore it. What did I do incorretly?
Code:
HDC SaveScn;
// other variables in code
tx=GetSystemMetrics(SM_CXFULLSCREEN);
ty=GetSystemMetrics(SM_CYFULLSCREEN);
void SaveScreen()
{
HDC CurScn;
// Save all graphics on screen
SaveScn = CreateCompatibleDC(0);
CurScn = GetDC(OrghWnd);
BitBlt(SaveScn, 0, 0, tx, tx+360, CurScn, 0, 0, SRCCOPY);
ReleaseDC(OrghWnd,CurScn);
GetKey(OrghWnd);
}
void RestoreScreen()
{
HDC CurScn;
// Restore saved screen
CurScn = GetDC(OrghWnd);
// SelectObject(CurScn, SaveScn);
BitBlt(CurScn, 0, 0, tx, ty+360, SaveScn, 0, 0, SRCCOPY);
ReleaseDC(OrghWnd,CurScn);
GetKey(OrghWnd);
}