Click here to Skip to main content
Click here to Skip to main content

Fast screen, window, region and print screen capture

, 4 Dec 2002 CPOL
Rate this:
Please Sign up or sign in to vote.
Screen Snaper is an fast screen, window, region and print screen capture

Sample Image - ScreenSnaper.gif


Screen Snaper is an simple application for Screen capture and snapshot. The application use exported function from library SnaperHelper.dll compatible with VC, VB, Delphi and other languages that can use DLL.

Snapshot features

  • Get Desktop window
  • Get Window on the Desktop
  • Get Region of the desktop
  • Trap Print Screen key

In Window and Region capture mode, an helper show the zoomed position under the cursor and the current color. These modes also include keys shortcut and pop menu to permit switch between mode and much more...

About demo

This demo application include source code for clients in VC and VB. The source code of library SnaperHelper.dll is not provided.


  • 8 december 2002 - Demo project updated. Now include missing SnaperHelper.lib and SnaperHelperLib.h.



This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Canada Canada

Comments and Discussions

QuestionHow can I use the dll in C# PinmemberH.Riazi26-Jul-06 12:38 
Generalplese~~ send me the source code of SnaperHelper.dll Pinmemberend_inmyhome27-Jun-06 16:27 
GeneralWill this work in log off mode Pinmemberakarwa22-May-06 8:26 
GeneralPlease Help PinmemberMax_Power_Up11-May-06 2:23 
AnswerRe: Please Help PinmemberTalk To The Hand25-May-06 11:35 
I really don't know why this article is in the CODE project, if there is no CODE...
Use this, it's not perfect, but it's here!

//////////////////// THE AUTHOR'S NAME. SORRY!

public Image CaptureScreen()
return CaptureWindow( User32.GetDesktopWindow() );
/// Creates an Image object containing a screen shot of a specific window

/// The handle to the window. (In windows forms, this is obtained by the Handle property)
public Image CaptureWindow(IntPtr handle)
// get te hDC of the target window
IntPtr hdcSrc = User32.GetWindowDC(handle);
// get the size
User32.RECT windowRect = new User32.RECT();
User32.GetWindowRect(handle,ref windowRect);
int width = windowRect.right - windowRect.left;
int height = windowRect.bottom -;
// create a device context we can copy to
IntPtr hdcDest = GDI32.CreateCompatibleDC(hdcSrc);
// create a bitmap we can copy it to,
// using GetDeviceCaps to get the width/height
IntPtr hBitmap = GDI32.CreateCompatibleBitmap(hdcSrc,width,height);
// select the bitmap object
IntPtr hOld = GDI32.SelectObject(hdcDest,hBitmap);
// bitblt over
// restore selection
// clean up
// get a .NET image object for it
Image img = Image.FromHbitmap(hBitmap);
// free up the Bitmap object
return img;
/// Captures a screen shot of a specific window, and saves it to a file

public void CaptureWindowToFile(IntPtr handle, string filename, ImageFormat format)
Image img = CaptureWindow(handle);
/// Captures a screen shot of the entire desktop, and saves it to a file

public void CaptureScreenToFile(string filename, ImageFormat format)
Image img = CaptureScreen();

/// Helper class containing Gdi32 API functions

private class GDI32

public const int SRCCOPY = 0x00CC0020; // BitBlt dwRop parameter
public static extern bool BitBlt(IntPtr hObject,int nXDest,int nYDest,
int nWidth,int nHeight,IntPtr hObjectSource,
int nXSrc,int nYSrc,int dwRop);
public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC,int nWidth,
int nHeight);
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
public static extern bool DeleteDC(IntPtr hDC);
public static extern bool DeleteObject(IntPtr hObject);
public static extern IntPtr SelectObject(IntPtr hDC,IntPtr hObject);

/// Helper class containing User32 API functions

private class User32
public struct RECT
public int left;
public int top;
public int right;
public int bottom;
public static extern IntPtr GetDesktopWindow();
public static extern IntPtr GetWindowDC(IntPtr hWnd);
public static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hDC);
public static extern IntPtr GetWindowRect(IntPtr hWnd,ref RECT rect);

Generalplese send me the source code of SnaperHelper.dll Pinmemberayyagarishankar20-Feb-06 21:54 
Generalwant source code of SnaperHelper.dll Pinmemberayyagarishankar20-Feb-06 21:49 
Generalcapture image without displaying application window Pinmemberjags_vc15-Feb-05 20:10 
GeneralRe: capture image without displaying application window Pinmembervishalmore26-Feb-05 3:15 
GeneralPrinting a Screen capture in C# PinsussAnonymous26-Jan-05 16:41 
GeneralDemo Update For MSVS .NET 2003 (VB And C#) PinmemberDany Cantin13-Nov-04 17:44 
GeneralFixing the region PinsussWon Huh24-Oct-04 22:15 
GeneralScreen capture fails for multiple instances Pinmembervishalmore5-Oct-04 0:33 
GeneralScreen capture Pinmemberangello16-Jun-04 5:06 
GeneralRe: Screen capture PinsussAnonymous1-Aug-04 1:09 
GeneralRe: Screen capture Pinmembereligetiv9-Jan-05 12:21 
GeneralRe: Screen capture PinmemberMax_Power_Up26-May-06 0:54 
GeneralRe: Screen capture PinmemberMax_Power_Up27-Nov-06 2:41 
GeneralVery well Pinmemberbenni19-Mar-04 2:31 
Generalautoscroll feature Pinmemberledang5-Jan-04 23:29 
Generalsource code PinmemberVK15-Dec-03 0:28 
Generalregion coordinates Pinmemberhsiaod11-Jun-03 23:39 
GeneralRe: region coordinates PinmemberDany Cantin12-Jun-03 3:22 
GeneralRe: region coordinates Pinmemberhsiaod12-Jun-03 10:57 
GeneralRe: region coordinates Pinmemberobni19913-Dec-06 8:00 
GeneralWhats it all about if source code is not provided... PinmemberBilal Ahmed9-Jun-03 17:21 
GeneralRe: Whats it all about if source code is not provided... PinmemberDany Cantin9-Jun-03 17:52 
GeneralNice work Pinmembermgama19-Feb-03 9:20 
GeneralGood job!!! Pinmemberjedyking22-Jan-03 7:53 
GeneralRe: Good job!!! PinmemberDany Cantin23-Jan-03 12:22 
Generalvery poor PinmemberAhmed Ismaiel Zakaria6-Dec-02 9:37 
GeneralRe: very poor PinmemberCosmoS2k6-Dec-02 10:21 
GeneralRe: very poor PinmemberJohn Simmons / outlaw programmer6-Dec-02 15:39 
QuestionWhy ??? Pinmemberhugo20106-Dec-02 8:04 
GeneralIcon similar to Hyper-Snap PinmemberAlexandru Savescu6-Dec-02 5:34 
QuestionPlaySoundA ??? PinmemberAndreas Saurwein6-Dec-02 4:51 
GeneralIl manque des fichiers ! PinmemberMaximilien6-Dec-02 4:32 
GeneralRe: Il manque des fichiers ! PinmemberDany Cantin6-Dec-02 5:26 
GeneralI gave you 1....b'cos PinmemberKant5-Dec-02 17:38 
GeneralRe: I gave you 1....b'cos PinmemberDany Cantin5-Dec-02 18:22 
GeneralRe: I gave you 1....b'cos PinmemberAndreas Saurwein6-Dec-02 3:41 
GeneralRe: I gave you 1....b'cos PinmemberAnna-Jayne Metcalfe6-Dec-02 4:10 
GeneralRe: I gave you 1....b'cos PinmemberKant6-Dec-02 6:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150414.1 | Last Updated 5 Dec 2002
Article Copyright 2002 by DCUtility
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid