Results 1 to 15 of 15

Thread: Attempting to save current screen

Threaded View

  1. #1

    Thread Starter
    Banned randem's Avatar
    Join Date
    Oct 2002
    Location
    Maui, Hawaii
    Posts
    11,385

    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);
    }
    Last edited by randem; Jul 10th, 2003 at 02:18 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width