Win32 equivalent of .net SendKeys

心已入冬 提交于 2019-12-01 06:01:28

问题


I am designing a system that reads a gesture from Kinect and make some actions. I am trying to include the system to be able to send HotKey to an application. My system is writing in c++ but the UI is in C++.net. I have been able to use SendKeys from the UI part and it does work.

Is there a Win32 equivalent so I can use it in my system?

Thanks in advance!


回答1:


In WIN32, SendKeys is called SendInput:

http://msdn.microsoft.com/en-us/library/ms646310(v=vs.85).aspx

It can also simulate mouse movements, etc.




回答2:


If there are multiple applications, on Vista and higher, UAC integrity levels may prevent applications from sending/receiving Windows messages this way. You may need to call ChangeWindowMessageFilter, ChangeWindowMessageFilterEx functions to enable message-reception in higher elevated process.




回答3:


The native equivalent is keybd_event

http://msdn.microsoft.com/en-us/library/ms646304(v=vs.85).aspx



来源:https://stackoverflow.com/questions/6838363/win32-equivalent-of-net-sendkeys

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