Reputation: 21
How to use the windows API to communicate with other applications?
For example, another application has a textbox, I have already set mouse on there using mouse_event, but I don't know how to send a string to it, and display the string on that textbox?
Upvotes: 0
Views: 215
Reputation: 21
Thank you all! I have made it by using keybd_event, here is my code:
keybd_event((BYTE)VkKeyScan(lpMsg[i-1]), 0, 0, 0);
keybd_event((BYTE)VkKeyScan(lpMsg[i-1]), 0, KEYEVENTF_KEYUP, 0);
I have another question here, because the window I want to send text to isn't the normal ones, it's an internet form, which content has been downloaded from internet. So I cannot use SetWindowText
or something else, but to simulate the keyboard input.
My question is: A form contains many buttons and textboxes and labels and something else. The function EnumChildWindows(hwndGame, EnumChildProc, 0);
Will continues until the last child window is enumerated or the callback function returns FALSE. What are Child windows? Are those buttons and textboxes on this form ??
Upvotes: 1