|
-
Oct 13th, 2004, 03:24 AM
#4
Fanatic Member
If you need to send teh following:
CTRL + A
SendMessage mTargetHwnd, WM_CHAR, Asc(LCase$("A")) - 96, 0
A:
SendMessage mTargetHwnd, WM_IME_CHAR, Asc("A"), 0
Enter:
SendMessage mTargetHwnd, WM_CHAR, VK_RETURN, 0
Tab:
SendMessage mFormHwnd, WM_IME_KEYDOWN, VK_TAB, 0
Shift + Tab is a little more tricky:
SetForegroundWindow mFormHwnd
keybd_event VK_SHIFT, 0, 0, 0 'press shift
keybd_event VK_TAB, 0, 0, 0 'press tab
keybd_event VK_SHIFT, 0, 2, 0 'release shift
Spy ++ looks at what messages are sent to a window - almost everything you do can be done in either a sendmessage or a postmessage - with spy ++ you can see these messages and use the functions to send them yourself.
If the code needs too much changing you might aswell stay with sendkeys. Before each sendkeys statement do a SetForegroundWindow me.hwnd to stay focused.
My secretary hopes that I will pay her, her landlord hopes that she will produce some rent, the Electricity Board hopes that he will settle their bill, and so on. I find it a wonderfully optimistic way of life. [Dirk Gently]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|