I want to make a virtual keyboard. Do I need to send WM_KEYDOWN to the current active window or HWND_BROADCAST?

不想你离开。 提交于 2019-12-24 19:53:56

问题


I am making an app that simulates a keyboard. I will do it by sending WM_KEYDOWN to a window, but I am not sure where to send the message. to the currently active window or to HWND_BROADCAST?

Here is an other question I posted, related to this one.
If I send a WM_KEYDOWN message (using wndproc) will the computer hold the key down until I send WM_KEYUP?


回答1:


If make a generic virtual keyboard and not worry about which window is active (which is the window manager's business), you can use SendInput: http://msdn.microsoft.com/en-us/library/ms646310(VS.85).aspx



来源:https://stackoverflow.com/questions/2090058/i-want-to-make-a-virtual-keyboard-do-i-need-to-send-wm-keydown-to-the-current-a

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!