开发者

How to catch named event in Windows CE

开发者 https://www.devze.com 2023-01-13 07:54 出处:网络
In my project, I want to catch some named event from the system, like \"IDH/Presence\" or \"IDH/AmbiantLi开发者_运维问答ght\".

In my project, I want to catch some named event from the system, like "IDH/Presence" or "IDH/AmbiantLi开发者_运维问答ght".

How can I do that ?

Edit: Is that possible with the EventWaitHandle class of the Smart Device Framework ?

Thanks.


The CF itself doesn't provide the ability to use named system events.

The SDF's EventWaitHandle does provide the capability by using either of the constructors that allow for the name parameter.

The other option is to P/Invoke CreateEvent and WaitForSingle/WaitForMultipleObjects.


I am not familiar with the functionality you refer to in the SDF (ctacke will probably answer that). But, to wait on a named event handle you simple call CreateEvent with the name and wait on the handle that is returned.

Be aware that in case the event is auto reset, only one WaitForSingleObject call will catch it and then it will be reset so if other threads are waiting on the same handle you might not catch the event.

0

精彩评论

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