PDA

Click to See Complete Forum and Search --> : PostMessage API Call


Geronimo
Feb 17th, 2001, 11:51 AM
Is it possible to use this API call to send the keys like Shift + 6 and the all that goodness?

Feb 17th, 2001, 04:53 PM
Yes.

Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Const WM_KEYDOWN = &H100

Private Sub Command1_Click()
PostMessage hwnd, WM_KEYDOWN, vbKeyShift, 0
PostMessage hwnd, WM_KEYDOWN, vbKey6, 0
End Sub

Geronimo
Feb 18th, 2001, 06:03 AM
hmm I tryed what you said but it doesn't seem to work. It seems like all the code does is press an instant of shift then after thats done it presses an instant of 6 which would not give me the ^ that i'm looking for.