Is there a quick way to do this?
Printable View
Is there a quick way to do this?
Yes, instead to giving it HWND of the window, you give the HWND of the desktop by first getting the HWND using "GetDesktopWindow()".
uh oh . . . I've been using alt + print screen, I'm not too clear on HWND and GetDesktopWindow().
Oh ok, If you are using that method, then instead of using "alt + print", use "print".
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
LOL . . . Let me get this straight, you mean I've got to press Print Screen instead of Alt + Print Screen??? Wait a minute, let me write that down . . . ;) (How could I not have at least tried that?)
The code snipped is pretty handy, too. Thanks guys!
gee i thought everyone knew that i knew when i was 10!
Bug off :D I'd always used alt + print screen, okay?
:rolleyes:
:)