February 25th, 2015, 08:16 PM
Is there an alternative API to process events in windows-runtime / metro? . Something other than the CoreWindow Dispatcher's ProcessEvents method?
That scheme relies on registering events handlers (function pointers in real money) that get called. I'd prefer something more similar to Unix/x11's get XNextEvent, a function that simply populates a structure with the event data to then be delt with after the call via a switch statement or something.
I can emulate the API I seek, by creating a ton of pointless event handlers that stash the data somewhere when they are invoked and use the CoreProcessEventsOption called ProcessOneIfPresent so I can look for the data after each event. This seems like an ugly and silly thing to do if an API already exists in windows. I can't find it.
Such a solution also won't work if ProcessOneIfPresent can tripp on events not registered (I won't be able to tell the difference between there being no more events now and their being an event I don't handle in the queue. -both cases would see the ProcessEvents function return without any of my handlers being called). The windows docs don't seem to provide even basic information on corner cases.
The doc 'instructs' me to use ProcessAllIfPending for store apps and not the ProcessOneIfPresent option I would need. Should I be worried about this? To emulate the behaviour with the option I am instructed to use requires an even uglier thread based solution. Perhaps I should stop thinking.
Last edited by Greg658; February 25th, 2015 at 08:59 PM.
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!