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 ??