Results 1 to 3 of 3

Thread: PostMessage API Call

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    7
    Is it possible to use this API call to send the keys like Shift + 6 and the all that goodness?

  2. #2
    Guest
    Yes.
    Code:
    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

  3. #3

    Thread Starter
    New Member
    Join Date
    Jan 2001
    Posts
    7
    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.

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