VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Screen Capture Module

by Angsuman Banerji (23 Submissions)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 18th April 2008
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Screen Capture Module

Rate Screen Capture Module




On Error GoTo ErrorHandler
'Check if the file Exists
If Dir(myFile) <> "" Then Exit Function
'capture the complete screen
Call keybd_event(vbKeySnapshot, 1, 0, 0)
'To get the Active Window
'Call keybd_event(vbKeySnapshot, 0, 0, 0)

SavePicture Clipboard.GetData(vbCFBitmap), myFile
CaptureScreen = True
Exit Function

ErrorHandler:
MsgBox "Error Occured " & Err.Description
End Function

 

Private Sub Command1_Click()
Call CaptureScreen("c:\screencap.bmp")
End Sub


Download this snippet    Add to My Saved Code

Screen Capture Module Comments

No comments have been posted about Screen Capture Module. Why not be the first to post a comment about Screen Capture Module.

Post your comment

Subject:
Message:
0/1000 characters