PDA

Click to See Complete Forum and Search --> : key output


Japalo
Jan 27th, 2000, 05:50 AM
Is it possible to have the form output the command for the computer to do the same thing as print screen key or some of the window based keys?

------------------

Aaron Young
Jan 27th, 2000, 07:03 AM
You can use Sendkeys to Mimic most Windows Keypresses, or the Keybd_Event API, the only way to Mimic the Print Screen Key is to use the Keybd_Event with the VK_SNAPSHOT Const, ie.
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 cmdFullScreen_Click()
'Send Copy of the Whole Screen to the Clipboard
keybd_event VK_SNAPSHOT, 1, 0, 0
End Sub

Private Sub cmdWindow_Click()
'Send Copy of the Active Window to the Clipboard
keybd_event VK_SNAPSHOT, 0, 0, 0
End Sub

------------------
Aaron Young
Analyst Programmer
aarony@redwingsoftware.com
ajyoung@pressenter.com



[This message has been edited by Aaron Young (edited 01-27-2000).]