Click here to Skip to main content
12,816,406 members (32,449 online)
Click here to Skip to main content
Add your own
alternative version


64 bookmarked
Posted 4 Dec 2002

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

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
		/// </summary>
		/// <param name="handle">The handle to the window. (In windows forms, this is obtained by the Handle property)</param>
		/// <returns></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
		/// </summary>
		/// <param name="handle"></param>
		/// <param name="filename"></param>
		/// <param name="format"></param>
		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
		/// </summary>
		/// <param name="filename"></param>
		/// <param name="format"></param>
		public void CaptureScreenToFile(string filename, ImageFormat format) 
			Image img = CaptureScreen();

		/// <summary>
		/// Helper class containing Gdi32 API functions
		/// </summary>
		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
		/// </summary>
		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 

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 5 Dec 2002
Article Copyright 2002 by DCUtility
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid