how to send a key stroke window message to a hwnd through JNA
I am just wondering if anyone could please give an ex开发者_StackOverflow中文版ample of sending a key press window message to a given hwnd using JNA. I tried to use SendMessageA
but it did not work at all.
Thanks a lot.
SendInput()
is the officially sanctioned way to fake input. The limitation is that it sends input to the window that has input focus which may not be what you need.
Another option would be to send a WM_SETTEXT
, or similar, if the target window responds appropriately.
Exactly what the best option is will depend on exactly what type of window you are targetting, which you have not said.
精彩评论