VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

A Way to take a screenshot

Steve  (12 Submissions)   Custom Controls/Forms/Menus   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

This code simply takes a picture of your desktop or a screenshot. I guess if you wanted to you could use this to view the desktop of a computer over a network, although that would be a bit slow. I hope this code is of some interest to some people Hope this helps.

Assumes
'Check out my website at http://www.vbtutor.com 'Thanks Set the Form properties to the following: AutoRedraw True BorderStyle 0 - None WindowState 2 - Maximized

API Declarations
'Check out my site at http://www.vbtutor.com
'Thanks
Declare Function BitBlt Lib "gdi32" _
(ByVal hDestDC As Integer, ByVal x As Integer, _
ByVal y As Integer, ByVal nWidth As Integer, _
ByVal nHeight As Integer, ByVal _
hSrcDC As Integer, ByVal xSrc As Integer, _
ByVal ySrc As Integer, ByVal dwRop As _
Long) As Integer
Declare Function GetDesktopWindow Lib "user32" () As Long
Declare Function GetDC Lib "user32" _
(ByVal hwnd As Long) As Long
Public Const SRCCOPY = &HCC0020
Public Const SRCAND = &H8800C6
Public Const SRCINVERT = &H660046

Rate A Way to take a screenshot (7(7 Vote))
A Way to take a screenshot.bas

A Way to take a screenshot Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters