Results 1 to 2 of 2

Thread: key output

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 1999
    Location
    Mesa,Az,USA
    Posts
    3

    Post

    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?

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

  2. #2
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    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.
    Code:
    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
    [email protected]
    [email protected]



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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width