Hi, is there a possibility to determ the current number of messages in the message queue of my task? I do some timing with WM_TIMERs and I want to check the queue for any overflow. What does Windows do, if more messages arrive, than can be processed? beaster.
Posted on 2001-01-19 10:52:00 by beaster
look up the GetQueueStatus function on the msdn. if gives a somewhat vaugue description of the return value though. it says that the highword is the 'types of messages currently in the queue.' it might actually be the number of messages that match the value of the flags parameter. and i think i remember reading that windows expands the queue dynamically, so you shouldn't have to worry aobut that.
Posted on 2001-01-19 16:46:00 by Sloat
if you are using timer messages, you do NOT nesscery have to get windows to post a WM_TIMER message to you any message que. for some examples all these call create a timer with an id of 1000 and a timeout of 12 ms: invoke SetTimer ,hWnd,1000,12,NULL ;Posts a WM_TIMER message to your windows message que every 12ms invoke SetTimer ,NULL,1000,12,NULL ;Posts a WM_TIMER message to your threads message que every 12ms invoke SetTimer ,hWnd,1000,12,Offset WndProc ;This is the best and most efficiant method to use, lookup the description on the TimerProc procedure, it is exactly the same as a window procedure for the sole purpose that it allows windows to directly call your WndProc without any message processing overheads. Also if you want you thread to wait for a couple of seconds before continuing onto a different task, invoke Sleep ,2000 creates a 2 second delay
Posted on 2001-01-19 20:10:00 by X