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

Fast screen, window, region and print screen capture

By , 4 Dec 2002
 

Sample Image - ScreenSnaper.gif

Introduction

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.

History

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

Enjoy!

License

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

About the Author

DCUtility
Other DCUtility
Canada Canada
Member

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1memberVEMS28 Apr '11 - 10:23 
No source on DLL .. copyrighted
QuestionHow to save image?membercq4 Aug '10 - 20:50 
How do you save the captured image to a file?
QuestionCan you send the source code, please?memberBlueSmile27 Oct '09 - 16:17 
I need to find out the x1, y1, x2, y2 coordinates of mouse click point on the screen.
 
But this program don't support.
 
So I require your assistance.

thank you.
 

mystarb612@gmail.com
GeneralMy vote of 1membertogga23 Jun '09 - 3:31 
No source code!
GeneralMy vote of 1memberRicado20 Mar '09 - 23:41 
Is this a show case of commercail component?
GeneralMy vote of 1memberSuhib N. Rawshdeh13 Mar '09 - 20:32 
no source code, just an ad
useless article without a source code
QuestionSend source code of the dll?memberwww.phoenix.com19 Jan '09 - 23:17 
Can you send the source code, please?
I wonder how your application could be so excellent.
 
Email: phoenix198425@hotmail.com
 
Thanks!
GeneralMy vote of 1memberbabyprez24 Dec '08 - 20:22 
just an ad, no source code
QuestionSachin Moulemembersachin moule28 Sep '08 - 23:01 
Please give me sorce code of the dll . so that i will able to use
use it as my requirement.
 
Waiting For Responce
sachin Moule
9420691932
GeneralDLLScreenCapmemberpointer11 Mar '08 - 4:33 
MSDN sample to capture screen or active window (DLLScreenCap)!!
Enjoy!!
 
ms-help://MS.VSCC.2003/MS.MSDNQTR.2004APR.1033/vcsample/html/vcsamDllScreenCapSample.htm
QuestionSoundmemberharmanator8921 Nov '07 - 10:54 
Has anyone found a way to disable or remove the sound from the program, so it doesn't play it when it captures the screen.
 
AH
QuestionHow to manage "Screen Snaper·" as WinForm ControlmemberMiguel Angel Fernadez Pinedo15 Jun '07 - 1:45 

 
Hello everybody,
 
i'd like to know how to use "Screen Snaper" as a Winform Control in order to include it in a C# application.
Is it possible?
 

Thanks everybody.
 
Regards.
 
Miguel
GeneralScreenSnaperHelper SourcememberDCUtility16 Mar '07 - 13:02 
The source code is now available at Screen Snaper SideBar Gadget Cool | :cool:
 
L'enfer est pavé de bonnes intentions! Rose | [Rose] The road to hell is paved with good intentions!

Questioncan you send me the dll pls?memberdimchae15 Mar '07 - 17:47 
can you send me the dll pls?
gorory@naver.com Sniff | :^) Sniff | :^)
 
test

Questionsource code of the SnaperHelper.dll?memberSuper Garrison27 Jan '07 - 14:17 
Can someone email me the source code of the SnaperHelper.dll?
 
Very much appreciated,
 
nowlex2000@yahoo.com
 

 

QuestionSourcememberRolandoParedes23 Jan '07 - 11:57 
Can somebody email me the source code of the SnaperHelper.dll? Thanks,
 
rparedes@peinc.com
QuestionCould someone send me the source code of DLL?memberjohn5188826 Dec '06 - 15:29 
Please send it to yongluo888@yahoo.com.
Thanks very much!

 
John888

QuestionSource of the DLL??memberlastchance3417 Sep '06 - 20:09 
can i please have the source to snapperhelper.dll?
 
localmotion34@hotmail.com
 
NOTE: there is also a bug with the tracking window that displays the zoom and mouse coordinates. sometimes it will refuse to repaint itself when certain types of windows were open when calling the getregionimage or getwindowimage. id like to be able to fully disable the tracking window.
 
if ANYONE has the source, please send it to me
Questioncan you send me the dll pls?memberdodeldomessenger7 Sep '06 - 4:36 
messenger@doglover.com
thank youBig Grin | :-D
QuestionHow can I use the dll in C#memberH.Riazi26 Jul '06 - 11:38 
Hi;
I would like to use your dll in my C# application. But when I try to import the dll an error apears.
 
Could you please help me on this.
 
Thanks
Hadi
Generalplese~~ send me the source code of SnaperHelper.dllmemberend_inmyhome27 Jun '06 - 15:27 
Any one have SnaperHelper.dll's source code please send it to me.
thanks.
my e-mail : hotsyc0101@hotmail.com
GeneralWill this work in log off modememberakarwa22 May '06 - 7:26 
If I have a machine with no sessions, but jobs are running, will your program be able to capture the screen shot .
I want to manage remote machines, which send a screen shot of their screens every 15 seconds. That I can find out if any error message has popped up on any of the machines.

GeneralPlease HelpmemberMax_Power_Up11 May '06 - 1:23 
Please help , I would desperately appreciate it if you could send me
the source code for screencapture.dll , I am currently creating an application that requires the image from the desktop to be stored in a file.

 
The tears shed in vain
and the hatred and pain
will be nothing but dust
at the end of the day
AnswerRe: Please HelpmemberTalk 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!

/////////////////////////////////////////////////////////////////////////
//////////////////// THIS CODE WASN'T CREATED BY ME, BUT I DON'T REMEMBER
//////////////////// 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 - windowRect.top;
// 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
GDI32.BitBlt(hdcDest,0,0,width,height,hdcSrc,0,0,GDI32.SRCCOPY);
// restore selection
GDI32.SelectObject(hdcDest,hOld);
// clean up
GDI32.DeleteDC(hdcDest);
User32.ReleaseDC(handle,hdcSrc);
// get a .NET image object for it
Image img = Image.FromHbitmap(hBitmap);
// free up the Bitmap object
GDI32.DeleteObject(hBitmap);
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);
img.Save(filename,format);
}
///
/// Captures a screen shot of the entire desktop, and saves it to a file
///

///
///
public void CaptureScreenToFile(string filename, ImageFormat format)
{
Image img = CaptureScreen();
img.Save(filename,format);
}
 
///
/// Helper class containing Gdi32 API functions
///

private class GDI32
{

public const int SRCCOPY = 0x00CC0020; // BitBlt dwRop parameter
[DllImport("gdi32.dll")]
public static extern bool BitBlt(IntPtr hObject,int nXDest,int nYDest,
int nWidth,int nHeight,IntPtr hObjectSource,
int nXSrc,int nYSrc,int dwRop);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateCompatibleBitmap(IntPtr hDC,int nWidth,
int nHeight);
[DllImport("gdi32.dll")]
public static extern IntPtr CreateCompatibleDC(IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern bool DeleteDC(IntPtr hDC);
[DllImport("gdi32.dll")]
public static extern bool DeleteObject(IntPtr hObject);
[DllImport("gdi32.dll")]
public static extern IntPtr SelectObject(IntPtr hDC,IntPtr hObject);
}
 
///
/// Helper class containing User32 API functions
///

private class User32
{
[StructLayout(LayoutKind.Sequential)]
public struct RECT
{
public int left;
public int top;
public int right;
public int bottom;
}
[DllImport("user32.dll")]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll")]
public static extern IntPtr GetWindowDC(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr ReleaseDC(IntPtr hWnd,IntPtr hDC);
[DllImport("user32.dll")]
public static extern IntPtr GetWindowRect(IntPtr hWnd,ref RECT rect);
}

Generalplese send me the source code of SnaperHelper.dllmemberayyagarishankar20 Feb '06 - 20:54 
Any one have SnaperHelper.dll's source code please send it to me.
thanks.
my e-mail : ayyagari_shankar@yahoo.com
 
shankar

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

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