I am sending messages to other windows using the PostMessage API. For example, I open calc and send it the Ctrl+V message (which is the hotkey for paste). That works OK. The problem comes when I want to send and Alt+something command. I don't know the constants for alt, and they are not in the KeyCodeConstants enum. Please help.
Here is what I have now:
VB Code:
Private Sub Command2_Click() Dim winhwnd As Long winhwnd = FindWindow(vbNullString, "calculator") PostMessage winhwnd, WM_KEYDOWN, vbKeyControl, 0 PostMessage winhwnd, WM_KEYDOWN, vbKeyV, 0 PostMessage winhwnd, WM_KEYUP, vbKeyV, 0 PostMessage winhwnd, WM_KEYUP, vbKeyControl, 0 End Sub




Reply With Quote