Click here to Skip to main content
12,508,112 members (42,779 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 can I use the dll in C# Pin
H.Riazi26-Jul-06 11:38
memberH.Riazi26-Jul-06 11:38 
Generalplese~~ send me the source code of SnaperHelper.dll Pin
end_inmyhome27-Jun-06 15:27
memberend_inmyhome27-Jun-06 15:27 
GeneralWill this work in log off mode Pin
akarwa22-May-06 7:26
memberakarwa22-May-06 7:26 
GeneralPlease Help Pin
Max_Power_Up11-May-06 1:23
memberMax_Power_Up11-May-06 1:23 
AnswerRe: Please Help Pin
Talk To The Hand25-May-06 10:35
memberTalk To The Hand25-May-06 10: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() );
/// 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;
public void CaptureWindowToFile(IntPtr handle, string filename, ImageFormat format)
Image img = CaptureWindow(handle);
public void CaptureScreenToFile(string filename, ImageFormat format)
Image img = CaptureScreen();

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

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 20:54
memberayyagarishankar20-Feb-06 20:54 
Generalwant source code of SnaperHelper.dll Pin
ayyagarishankar20-Feb-06 20:49
memberayyagarishankar20-Feb-06 20:49 
Generalcapture image without displaying application window Pin
jags_vc15-Feb-05 19:10
memberjags_vc15-Feb-05 19:10 
GeneralRe: capture image without displaying application window Pin
vishalmore26-Feb-05 2:15
membervishalmore26-Feb-05 2:15 
GeneralPrinting a Screen capture in C# Pin
Anonymous26-Jan-05 15:41
sussAnonymous26-Jan-05 15:41 
GeneralDemo Update For MSVS .NET 2003 (VB And C#) Pin
Dany Cantin13-Nov-04 16:44
memberDany Cantin13-Nov-04 16:44 
GeneralFixing the region Pin
Won Huh24-Oct-04 21:15
sussWon Huh24-Oct-04 21:15 
GeneralScreen capture fails for multiple instances Pin
vishalmore4-Oct-04 23:33
membervishalmore4-Oct-04 23:33 
GeneralScreen capture Pin
angello16-Jun-04 4:06
memberangello16-Jun-04 4:06 
GeneralRe: Screen capture Pin
Anonymous1-Aug-04 0:09
sussAnonymous1-Aug-04 0:09 
GeneralRe: Screen capture Pin
eligetiv9-Jan-05 11:21
membereligetiv9-Jan-05 11:21 
GeneralRe: Screen capture Pin
Max_Power_Up25-May-06 23:54
memberMax_Power_Up25-May-06 23:54 
GeneralRe: Screen capture Pin
Max_Power_Up27-Nov-06 1:41
memberMax_Power_Up27-Nov-06 1:41 
GeneralVery well Pin
benni19-Mar-04 1:31
memberbenni19-Mar-04 1:31 
Generalautoscroll feature Pin
ledang5-Jan-04 22:29
memberledang5-Jan-04 22:29 
Generalsource code Pin
VK14-Dec-03 23:28
memberVK14-Dec-03 23:28 
Generalregion coordinates Pin
hsiaod11-Jun-03 22:39
memberhsiaod11-Jun-03 22:39 
GeneralRe: region coordinates Pin
Dany Cantin12-Jun-03 2:22
memberDany Cantin12-Jun-03 2:22 
GeneralRe: region coordinates Pin
hsiaod12-Jun-03 9:57
memberhsiaod12-Jun-03 9:57 
GeneralRe: region coordinates Pin
obni19913-Dec-06 7:00
memberobni19913-Dec-06 7:00 
GeneralWhats it all about if source code is not provided... Pin
Bilal Ahmed9-Jun-03 16:21
memberBilal Ahmed9-Jun-03 16:21 
GeneralRe: Whats it all about if source code is not provided... Pin
Dany Cantin9-Jun-03 16:52
memberDany Cantin9-Jun-03 16:52 
GeneralNice work Pin
mgama19-Feb-03 8:20
membermgama19-Feb-03 8:20 
GeneralGood job!!! Pin
jedyking22-Jan-03 6:53
memberjedyking22-Jan-03 6:53 
GeneralRe: Good job!!! Pin
Dany Cantin23-Jan-03 11:22
memberDany Cantin23-Jan-03 11:22 
Generalvery poor Pin
Ahmed Ismaiel Zakaria6-Dec-02 8:37
memberAhmed Ismaiel Zakaria6-Dec-02 8:37 
GeneralRe: very poor Pin
CosmoS2k6-Dec-02 9:21
memberCosmoS2k6-Dec-02 9:21 
GeneralRe: very poor Pin
John Simmons / outlaw programmer6-Dec-02 14:39
memberJohn Simmons / outlaw programmer6-Dec-02 14:39 
QuestionWhy ??? Pin
hugo20106-Dec-02 7:04
memberhugo20106-Dec-02 7:04 
GeneralIcon similar to Hyper-Snap Pin
Alexandru Savescu6-Dec-02 4:34
memberAlexandru Savescu6-Dec-02 4:34 
QuestionPlaySoundA ??? Pin
Andreas Saurwein6-Dec-02 3:51
memberAndreas Saurwein6-Dec-02 3:51 
GeneralIl manque des fichiers ! Pin
Maximilien6-Dec-02 3:32
memberMaximilien6-Dec-02 3:32 
GeneralRe: Il manque des fichiers ! Pin
Dany Cantin6-Dec-02 4:26
memberDany Cantin6-Dec-02 4:26 
GeneralI gave you 1....b'cos Pin
Kant5-Dec-02 16:38
memberKant5-Dec-02 16:38 
GeneralRe: I gave you 1....b'cos Pin
Dany Cantin5-Dec-02 17:22
memberDany Cantin5-Dec-02 17:22 
GeneralRe: I gave you 1....b'cos Pin
Andreas Saurwein6-Dec-02 2:41
memberAndreas Saurwein6-Dec-02 2:41 
GeneralRe: I gave you 1....b'cos Pin
Anna-Jayne Metcalfe6-Dec-02 3:10
memberAnna-Jayne Metcalfe6-Dec-02 3:10 
GeneralRe: I gave you 1....b'cos Pin
Kant6-Dec-02 5:38
memberKant6-Dec-02 5:38 

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.160927.1 | Last Updated 5 Dec 2002
Article Copyright 2002 by DCUtility
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid