View Single Post
Old 03-16-2006, 06:58 PM   #3 (permalink)
DJMaze
Senior Contributor
 
DJMaze's Avatar
 
Join Date: Mar 2005
Posts: 673
DJMaze is on a distinguished road
LOL i am correct and the systems are way different.

Win32 has PeekMessage() and so does Xlib, but Win32 returns 0 and stops where Xlib blocks and waits for the next message to occure.

So to get the same effect as Win32 we must use something like:
PHP Code:
int ProcessQueue()
{
#ifdef WIN32
    
MSG message;
    while (
PeekMessage(&msgNULL00PM_REMOVE) > 0)
    {
        if (
MSG.message == WM_QUIT) { return 0; }
        
TranslateMessage(&message);
        
DispatchMessage(&message);
    }
#else
    
XEvent message;
    while (
XEventsQueued(display_connect_idQueuedAfterReading))
    {
        
XNextEvent(display_connect_id, &message);
        
MyMessageHandler(message);
    }
    return 
1// all messages handled
#endif

just my $0.02
DJMaze is offline   Reply With Quote