Here is a quick example
VB Code:
Option Explicit Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _ ByVal dwFlags As Long, ByVal dwExtraInfo As Long) Private Const VK_SNAPSHOT = &H2C Private Sub Command1_Click() Clipboard.Clear ' Get the Entire Screen keybd_event vbKeySnapshot, 1, 0, 0 End Sub Private Sub Command2_Click() Clipboard.Clear ' Get the Active Window keybd_event vbKeySnapshot, 0, 0, 0 End Sub Private Sub Form_Load() Command1.Caption = "Full Screen" Command2.Caption = "Active Window" End Sub




Reply With Quote