Hello,
In my project, I want to catch some named event from the system, like "IDH/Presence" or "IDH/AmbiantLight".
How can I do that ?
Edit: Is that possible with the EventWaitHandle class of the Smart Device Framework ?
Thanks.
Hello,
In my project, I want to catch some named event from the system, like "IDH/Presence" or "IDH/AmbiantLight".
How can I do that ?
Edit: Is that possible with the EventWaitHandle class of the Smart Device Framework ?
Thanks.
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.
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.