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]
Printable View
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]
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