Results 1 to 2 of 2

Thread: HotKey, API amd windows apps

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Location
    Petach-Tekvia
    Posts
    25

    Post

    Hi guys
    I need help. I would like to have a new key
    that does that same operation as "Ctrl+C".
    I mean from ANYWHERE in windows just like
    Ctrl+C, if I press, say F12, it performs
    a 'COPY'.

    Thanks.
    Mansour.
    [email protected]

  2. #2
    Guest

    Post

    This should work, use the GetAsyncKeyState to see if the F12 is pressed, if it is pressed use sendkeys to send a ctrl-c.

    Code:
    Option Explicit
    Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
    Private Const VK_F12 As Long = &H7B
    
    Private Sub Command1_Click()
        Do
            If GetAsyncKeyState(VK_F12) <> 0 Then
                SendKeys "^C"
            End If
        Loop Until DoEvents = 0
    End Sub


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

    Vincent van den Braken
    EMail: [email protected]
    ICQ: 15440110
    Homepage: http://www.azzmodan.demon.nl




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