开发者

Win32 equivalent of .net SendKeys

开发者 https://www.devze.com 2023-03-22 22:45 出处:网络
I am desi开发者_如何学Gogning 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+

I am desi开发者_如何学Gogning 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!


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.


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.


The native equivalent is keybd_event

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

0

精彩评论

暂无评论...
验证码 换一张
取 消