lilkiddoe
asked on
using sendmessage to send ALT+ k to an app
can someone provide code to send the keystrokes alt + k to an app using sendmessage?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
call SendKeystroke(VBAltMask, Child)
call SendKeystroke(VBKeyK, Child)
call SendKeystroke(VBKeyK, Child)
Then get the handler for the app first
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
const VK_ALT = &HD
const VK_K = &H4B
dim hwnd as object
hwnd = findwindow(...) 'use spy++ to get the class and window name
sendmessage (hwnd, VK_ALT+VK_K, vbbullstring, vbnullstring)