Click here to Skip to main content
12,629,778 members (31,683 online)
Click here to Skip to main content
Add your own
alternative version


64 bookmarked

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

You may also be interested in...


Comments and Discussions

QuestionHow to use it in vs2012 project & request for dll source code,thanks a lot. Pin
chip_sunny19-Feb-14 1:31
memberchip_sunny19-Feb-14 1:31 
AnswerRe: How to use it in vs2012 project & request for dll source code,thanks a lot. Pin
DCUtility19-Feb-14 13:14
memberDCUtility19-Feb-14 13:14 
GeneralMy vote of 1 Pin
VEMS28-Apr-11 11:23
memberVEMS28-Apr-11 11:23 
QuestionHow to save image? Pin
cq4-Aug-10 21:50
membercq4-Aug-10 21:50 
QuestionCan you send the source code, please? Pin
BlueSmile27-Oct-09 17:17
memberBlueSmile27-Oct-09 17:17 
GeneralMy vote of 1 Pin
togga23-Jun-09 4:31
membertogga23-Jun-09 4:31 
GeneralMy vote of 1 Pin
Ricado21-Mar-09 0:41
memberRicado21-Mar-09 0:41 
GeneralMy vote of 1 Pin
Suhib N. Rawshdeh13-Mar-09 21:32
memberSuhib N. Rawshdeh13-Mar-09 21:32 
QuestionSend source code of the dll? Pin
www.phoenix.com20-Jan-09 0:17
memberwww.phoenix.com20-Jan-09 0:17 
GeneralMy vote of 1 Pin
babyprez24-Dec-08 21:22
memberbabyprez24-Dec-08 21:22 
QuestionSachin Moule Pin
sachin moule29-Sep-08 0:01
membersachin moule29-Sep-08 0:01 
GeneralDLLScreenCap Pin
pointer11-Mar-08 5:33
memberpointer11-Mar-08 5:33 
QuestionSound Pin
harmanator8921-Nov-07 11:54
memberharmanator8921-Nov-07 11:54 
QuestionHow to manage "Screen Snaper·" as WinForm Control Pin
Miguel Angel Fernadez Pinedo15-Jun-07 2:45
memberMiguel Angel Fernadez Pinedo15-Jun-07 2:45 
GeneralScreenSnaperHelper Source Pin
DCUtility16-Mar-07 14:02
memberDCUtility16-Mar-07 14:02 
Questioncan you send me the dll pls? Pin
dimchae15-Mar-07 18:47
memberdimchae15-Mar-07 18:47 
Questionsource code of the SnaperHelper.dll? Pin
Super Garrison27-Jan-07 15:17
memberSuper Garrison27-Jan-07 15:17 
QuestionSource Pin
RolandoParedes23-Jan-07 12:57
memberRolandoParedes23-Jan-07 12:57 
QuestionCould someone send me the source code of DLL? Pin
john5188826-Dec-06 16:29
memberjohn5188826-Dec-06 16:29 
QuestionSource of the DLL?? Pin
lastchance3417-Sep-06 21:09
memberlastchance3417-Sep-06 21:09 
Questioncan you send me the dll pls? Pin
dodeldomessenger7-Sep-06 5:36
memberdodeldomessenger7-Sep-06 5:36 
QuestionHow can I use the dll in C# Pin
H.Riazi26-Jul-06 12:38
memberH.Riazi26-Jul-06 12:38 
Generalplese~~ send me the source code of SnaperHelper.dll Pin
end_inmyhome27-Jun-06 16:27
memberend_inmyhome27-Jun-06 16:27 
GeneralWill this work in log off mode Pin
akarwa22-May-06 8:26
memberakarwa22-May-06 8:26 
GeneralPlease Help Pin
Max_Power_Up11-May-06 2:23
memberMax_Power_Up11-May-06 2:23 
AnswerRe: Please Help Pin
Talk To The Hand25-May-06 11:35
memberTalk 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() );
/// <summary>
/// Creates an Image object containing a screen shot of a specific window
/// <param name="handle" />The handle to the window. (In windows forms, this is obtained by the Handle property)
/// <returns>
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;
/// <summary>
/// Captures a screen shot of a specific window, and saves it to a file
/// <param name="handle" />
/// <param name="filename" />
/// <param name="format" />
public void CaptureWindowToFile(IntPtr handle, string filename, ImageFormat format)
Image img = CaptureWindow(handle);
/// <summary>
/// Captures a screen shot of the entire desktop, and saves it to a file
/// <param name="filename" />
/// <param name="format" />
public void CaptureScreenToFile(string filename, ImageFormat format)
Image img = CaptureScreen();

/// <summary>
/// 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);

/// <summary>
/// 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 Pin
ayyagarishankar20-Feb-06 21:54
memberayyagarishankar20-Feb-06 21:54 
Generalwant source code of SnaperHelper.dll Pin
ayyagarishankar20-Feb-06 21:49
memberayyagarishankar20-Feb-06 21:49 
Generalcapture image without displaying application window Pin
jags_vc15-Feb-05 20:10
memberjags_vc15-Feb-05 20:10 
GeneralRe: capture image without displaying application window Pin
vishalmore26-Feb-05 3:15
membervishalmore26-Feb-05 3:15 
GeneralPrinting a Screen capture in C# Pin
Anonymous26-Jan-05 16:41
sussAnonymous26-Jan-05 16:41 
GeneralDemo Update For MSVS .NET 2003 (VB And C#) Pin
Dany Cantin13-Nov-04 17:44
memberDany Cantin13-Nov-04 17:44 
GeneralFixing the region Pin
Won Huh24-Oct-04 22:15
sussWon Huh24-Oct-04 22:15 
GeneralScreen capture fails for multiple instances Pin
vishalmore5-Oct-04 0:33
membervishalmore5-Oct-04 0:33 
GeneralScreen capture Pin
angello16-Jun-04 5:06
memberangello16-Jun-04 5:06 
GeneralRe: Screen capture Pin
Anonymous1-Aug-04 1:09
sussAnonymous1-Aug-04 1:09 
GeneralRe: Screen capture Pin
eligetiv9-Jan-05 12:21
membereligetiv9-Jan-05 12:21 
GeneralRe: Screen capture Pin
Max_Power_Up26-May-06 0:54
memberMax_Power_Up26-May-06 0:54 
GeneralRe: Screen capture Pin
Max_Power_Up27-Nov-06 2:41
memberMax_Power_Up27-Nov-06 2:41 
GeneralVery well Pin
benni19-Mar-04 2:31
memberbenni19-Mar-04 2:31 
Generalautoscroll feature Pin
ledang5-Jan-04 23:29
memberledang5-Jan-04 23:29 
Generalsource code Pin
VK15-Dec-03 0:28
memberVK15-Dec-03 0:28 
Generalregion coordinates Pin
hsiaod11-Jun-03 23:39
memberhsiaod11-Jun-03 23:39 
GeneralRe: region coordinates Pin
Dany Cantin12-Jun-03 3:22
memberDany Cantin12-Jun-03 3:22 
GeneralRe: region coordinates Pin
hsiaod12-Jun-03 10:57
memberhsiaod12-Jun-03 10:57 
GeneralRe: region coordinates Pin
obni19913-Dec-06 8:00
memberobni19913-Dec-06 8:00 
GeneralWhats it all about if source code is not provided... Pin
Bilal Ahmed9-Jun-03 17:21
memberBilal Ahmed9-Jun-03 17:21 
GeneralRe: Whats it all about if source code is not provided... Pin
Dany Cantin9-Jun-03 17:52
memberDany Cantin9-Jun-03 17:52 
GeneralNice work Pin
mgama19-Feb-03 9:20
membermgama19-Feb-03 9:20 
GeneralGood job!!! Pin
jedyking22-Jan-03 7:53
memberjedyking22-Jan-03 7:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.161205.3 | Last Updated 5 Dec 2002
Article Copyright 2002 by DCUtility
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid