I’m implementing a cross-platform ‘completePending’ function for an event loop class that should simply parse n events that are in the queue. (n is grabbed at function start and only n events are parsed.)
So I leisurely strolled off into the sunset only to find myself in msdn, looking for a XEventsQueued() DWORD WINAPI WinQueuedEvents(__in_opt DWORD). But I could not seem to find one. I began to question the existence of such a function in the win32 api at all! And so I cometh to the wonderful abode of coders that is stackoverflow in search of answers.
As far as I know GetMessage() blocks untill a message is received. So if there isn’t a GetPending() i should just peek and get while there are messages for a not-nice alternative?
Functions that don’t block until you get (just) a windows message include:
PeekMessageMsgWaitForMultipleObjectsMsgWaitForMultipleObjectsExPlease note that you can pass
PM_REMOVEtoPeekMessageto have a non-blockingGetMessage.And also note that sent messages aren’t returned by these functions, they are immediately dispatched.