I'm working on an automation application for a proprietary windows-based host emulator in Windows XP. The application is written in VB6 and works well at passing keys to the host emulator using WM_KEYDOWN messages via PostMessage API calls. The problem that I have is that I don't know how to send keys that have a Shift/Ctrl/Alt component. For example, the following works great:
PostMessage hWnd, WM_KEYDOWN, vbKeyC, &H1& ' Lowercase "c"
PostMessage hWnd, WM_KEYDOWN, vbKeyUp, &H1& ' Up Arrow key
PostMessage hWnd, WM_KEYDOWN, vbKeyPageDown, &H1& ' Page Down key
How do I do the same for Shift-c (Capital C), Shift-ArrowUp, Ctrl-PgDn, or Alt-c? Posting a WM_KEYDOWN message for vbKeyShift/vbKeyControl has no effect before any of the above. The result is the same (unshifted).
Before anyone asks, I do not wish to change the focus from my application to the host when sending each key. (The application controls several host windows at the same time.) PostMessage does exactly what I want, except I can't figure out how to Shift/Ctrl/Alt the keys.
Any help would be appreciated...