VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Take a screenshot (BitBlt and DC's)

Adam Orenstein  (6 Submissions)   Custom Controls/Forms/Menus   Visual Basic 3.0   Advanced   Wed 3rd February 2021

My code here will allow you take a screen shot of the entire screen.

Assumes
Remeber when taking a screen shot the picture gets added to the destinations Image property not its image property. also don't forget to set the Autoredraw property of the destination of the image to True. Thanks!

API Declarations
Public Declare Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hdcSrc As Long, ByVal nXSrc As Long, ByVal nYSrc As Long, ByVal dwRop As Long) As Long
Public Declare Function GetDesktopWindow Lib "user32" () As Long
Public Declare Function GetDC Lib "user32.dll" (ByVal hwnd As Long) As Long
Public Declare Function ReleaseDC Lib "user32.dll" (ByVal hwnd As Long, ByVal hDC As Long) As Long

Rate Take a screenshot (BitBlt and DC's) (3(3 Vote))
Take a screenshot (BitBlt and DC's).bas

Take a screenshot (BitBlt and DC's) Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters