Private Sub Command1_Click()
#Const WINDOWS_VERSION = "Windows2000"
Dim alt_key As Long
' Capture an image of the form in the clipboard.
' Press Alt.
alt_key = MapVirtualKey(VK_MENU, 0)
keybd_event VK_MENU, alt_key, 0, 0
DoEvents
' Press Print Scrn.
#If WINDOWS_VERSION = "Windows2000" Then
keybd_event VK_SNAPSHOT, 0, 0, 0
#Else
keybd_event VK_SNAPSHOT, 1, 0, 0
#End If
DoEvents
' Release Alt.
keybd_event VK_MENU, alt_key, KEYEVENTF_KEYUP, 0
DoEvents
' Paste the image into the bitmap file.
SavePicture Clipboard.GetData(vbCFBitmap), Text1.Text
End Sub
|