2 * Message queues related functions
4 * Copyright 1993, 1994 Alexandre Julliard
17 #define MAX_QUEUE_SIZE 120 /* Max. size of a message queue */
19 static HQUEUE16 hFirstQueue
= 0;
20 static HQUEUE16 hDoomedQueue
= 0;
21 static HQUEUE16 hmemSysMsgQueue
= 0;
22 static MESSAGEQUEUE
*sysMsgQueue
= NULL
;
24 static MESSAGEQUEUE
*pMouseQueue
= NULL
; /* Queue for last mouse message */
25 static MESSAGEQUEUE
*pKbdQueue
= NULL
; /* Queue for last kbd message */
27 extern void SIGNAL_MaskAsyncEvents(BOOL32
);
29 MESSAGEQUEUE
*pCursorQueue
= NULL
;
30 MESSAGEQUEUE
*pActiveQueue
= NULL
;
32 /***********************************************************************
35 void QUEUE_DumpQueue( HQUEUE16 hQueue
)
39 if (!(pq
= (MESSAGEQUEUE
*) GlobalLock16( hQueue
)) ||
40 GlobalSize16(hQueue
) < sizeof(MESSAGEQUEUE
)+pq
->queueSize
*sizeof(QMSG
))
42 fprintf( stderr
, "%04x is not a queue handle\n", hQueue
);
47 "next: %12.4x Intertask SendMessage:\n"
48 "hTask: %11.4x ----------------------\n"
49 "msgSize: %9.4x hWnd: %10.4x\n"
50 "msgCount: %8.4x msg: %11.4x\n"
51 "msgNext: %9.4x wParam: %8.4x\n"
52 "msgFree: %9.4x lParam: %8.8x\n"
53 "qSize: %11.4x lRet: %10.8x\n"
54 "wWinVer: %9.4x ISMH: %10.4x\n"
55 "paints: %10.4x hSendTask: %5.4x\n"
56 "timers: %10.4x hPrevSend: %5.4x\n"
60 pq
->next
, pq
->hTask
, pq
->msgSize
, pq
->hWnd
,
61 pq
->msgCount
, pq
->msg
, pq
->nextMessage
, pq
->wParam
,
62 pq
->nextFreeMessage
, (unsigned)pq
->lParam
, pq
->queueSize
,
63 (unsigned)pq
->SendMessageReturn
, pq
->wWinVersion
, pq
->InSendMessageHandle
,
64 pq
->wPaintCount
, pq
->hSendingTask
, pq
->wTimerCount
,
65 pq
->hPrevSendingTask
, pq
->wakeBits
, pq
->wakeMask
, pq
->hCurHook
);
69 /***********************************************************************
72 void QUEUE_WalkQueues(void)
74 HQUEUE16 hQueue
= hFirstQueue
;
76 fprintf( stderr
, "Queue Size Msgs Task\n" );
79 MESSAGEQUEUE
*queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
);
82 fprintf( stderr
, "*** Bad queue handle %04x\n", hQueue
);
85 fprintf( stderr
, "%04x %5d %4d %04x %s\n",
86 hQueue
, queue
->msgSize
, queue
->msgCount
, queue
->hTask
,
87 MODULE_GetModuleName( GetExePtr(queue
->hTask
) ) );
90 fprintf( stderr
, "\n" );
94 /***********************************************************************
97 BOOL32
QUEUE_IsDoomedQueue( HQUEUE16 hQueue
)
99 return (hDoomedQueue
&& (hQueue
== hDoomedQueue
));
103 /***********************************************************************
104 * QUEUE_SetDoomedQueue
106 void QUEUE_SetDoomedQueue( HQUEUE16 hQueue
)
108 hDoomedQueue
= hQueue
;
112 /***********************************************************************
113 * QUEUE_CreateMsgQueue
115 * Creates a message queue. Doesn't link it into queue list!
117 static HQUEUE16
QUEUE_CreateMsgQueue( int size
)
120 MESSAGEQUEUE
* msgQueue
;
122 TDB
*pTask
= (TDB
*)GlobalLock16( GetCurrentTask() );
124 dprintf_msg(stddeb
,"Creating message queue...\n");
126 queueSize
= sizeof(MESSAGEQUEUE
) + size
* sizeof(QMSG
);
127 if (!(hQueue
= GlobalAlloc16( GMEM_FIXED
| GMEM_ZEROINIT
, queueSize
)))
129 msgQueue
= (MESSAGEQUEUE
*) GlobalLock16( hQueue
);
130 msgQueue
->self
= hQueue
;
131 msgQueue
->msgSize
= sizeof(QMSG
);
132 msgQueue
->queueSize
= size
;
133 msgQueue
->wakeBits
= msgQueue
->changeBits
= QS_SMPARAMSFREE
;
134 msgQueue
->wWinVersion
= pTask
? pTask
->version
: 0;
135 GlobalUnlock16( hQueue
);
140 /***********************************************************************
141 * QUEUE_DeleteMsgQueue
143 * Unlinks and deletes a message queue.
145 * Note: We need to mask asynchronous events to make sure PostMessage works
146 * even in the signal handler.
148 BOOL32
QUEUE_DeleteMsgQueue( HQUEUE16 hQueue
)
150 MESSAGEQUEUE
* msgQueue
= (MESSAGEQUEUE
*)GlobalLock16(hQueue
);
154 dprintf_msg(stddeb
,"Deleting message queue %04x\n", hQueue
);
156 if (!hQueue
|| !msgQueue
)
158 dprintf_msg(stddeb
,"DeleteMsgQueue: invalid argument.\n");
161 if( pCursorQueue
== msgQueue
) pCursorQueue
= NULL
;
162 if( pActiveQueue
== msgQueue
) pActiveQueue
= NULL
;
164 /* flush sent messages */
165 senderQ
= msgQueue
->hSendingTask
;
168 MESSAGEQUEUE
* sq
= (MESSAGEQUEUE
*)GlobalLock16(senderQ
);
170 sq
->SendMessageReturn
= 0L;
171 QUEUE_SetWakeBit( sq
, QS_SMRESULT
);
172 senderQ
= sq
->hPrevSendingTask
;
175 SIGNAL_MaskAsyncEvents( TRUE
);
177 pPrev
= &hFirstQueue
;
178 while (*pPrev
&& (*pPrev
!= hQueue
))
180 MESSAGEQUEUE
*msgQ
= (MESSAGEQUEUE
*)GlobalLock16(*pPrev
);
183 if (*pPrev
) *pPrev
= msgQueue
->next
;
186 SIGNAL_MaskAsyncEvents( FALSE
);
188 GlobalFree16( hQueue
);
193 /***********************************************************************
194 * QUEUE_CreateSysMsgQueue
196 * Create the system message queue, and set the double-click speed.
197 * Must be called only once.
199 BOOL32
QUEUE_CreateSysMsgQueue( int size
)
201 if (size
> MAX_QUEUE_SIZE
) size
= MAX_QUEUE_SIZE
;
202 else if (size
<= 0) size
= 1;
203 if (!(hmemSysMsgQueue
= QUEUE_CreateMsgQueue( size
))) return FALSE
;
204 sysMsgQueue
= (MESSAGEQUEUE
*) GlobalLock16( hmemSysMsgQueue
);
209 /***********************************************************************
212 MESSAGEQUEUE
*QUEUE_GetSysQueue(void)
218 /***********************************************************************
221 * See "Windows Internals", p.449
223 void QUEUE_SetWakeBit( MESSAGEQUEUE
*queue
, WORD bit
)
225 dprintf_msg(stddeb
,"SetWakeBit: queue = %04x (wm=%04x), bit = %04x\n",
226 queue
->self
, queue
->wakeMask
, bit
);
228 if (bit
& QS_MOUSE
) pMouseQueue
= queue
;
229 if (bit
& QS_KEY
) pKbdQueue
= queue
;
230 queue
->changeBits
|= bit
;
231 queue
->wakeBits
|= bit
;
232 if (queue
->wakeMask
& bit
)
235 PostEvent( queue
->hTask
);
240 /***********************************************************************
243 void QUEUE_ClearWakeBit( MESSAGEQUEUE
*queue
, WORD bit
)
245 queue
->changeBits
&= ~bit
;
246 queue
->wakeBits
&= ~bit
;
250 /***********************************************************************
253 * See "Windows Internals", p.447
255 void QUEUE_WaitBits( WORD bits
)
259 dprintf_msg(stddeb
,"WaitBits: q %04x waiting for %04x\n", GetTaskQueue(0), bits
);
263 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return;
265 if (queue
->changeBits
& bits
)
267 /* One of the bits is set; we can return */
271 if (queue
->wakeBits
& QS_SENDMESSAGE
)
273 /* Process the sent message immediately */
276 QUEUE_ReceiveMessage( queue
);
277 continue; /* nested sm crux */
280 queue
->wakeMask
= bits
| QS_SENDMESSAGE
;
281 if(queue
->changeBits
& bits
) continue;
283 dprintf_msg(stddeb
,"wb: (%04x) wakeMask is %04x, waiting\n", queue
->self
, queue
->wakeMask
);
290 /***********************************************************************
291 * QUEUE_ReceiveMessage
293 * This routine is called when a sent message is waiting for the queue.
295 void QUEUE_ReceiveMessage( MESSAGEQUEUE
*queue
)
297 MESSAGEQUEUE
*senderQ
= NULL
;
298 HQUEUE16 prevSender
= 0;
299 QSMCTRL
* prevCtrlPtr
= NULL
;
302 dprintf_msg(stddeb
, "ReceiveMessage, queue %04x\n", queue
->self
);
303 if (!(queue
->wakeBits
& QS_SENDMESSAGE
) ||
304 !(senderQ
= (MESSAGEQUEUE
*)GlobalLock16( queue
->hSendingTask
)))
305 { dprintf_msg(stddeb
,"\trcm: nothing to do\n"); return; }
307 queue
->InSendMessageHandle
= queue
->hSendingTask
;
308 if( !(queue
->hSendingTask
= senderQ
->hPrevSendingTask
) )
310 queue
->wakeBits
&= ~QS_SENDMESSAGE
; /* no more sent messages */
311 queue
->changeBits
&= ~QS_SENDMESSAGE
;
314 /* Remove sending queue from the list */
315 prevSender
= queue
->InSendMessageHandle
;
316 prevCtrlPtr
= queue
->smResultCurrent
;
317 queue
->smResultCurrent
= senderQ
->smResultInit
;
319 dprintf_msg(stddeb
, "\trcm: smResultCurrent = %08x, prevCtrl = %08x\n",
320 (unsigned)queue
->smResultCurrent
, (unsigned)prevCtrlPtr
);
321 QUEUE_SetWakeBit( senderQ
, QS_SMPARAMSFREE
);
323 dprintf_msg(stddeb
, "\trcm: calling wndproc - %04x %04x %04x %08x\n",
324 senderQ
->hWnd
, senderQ
->msg
, senderQ
->wParam
, (unsigned)senderQ
->lParam
);
326 if (IsWindow( senderQ
->hWnd
))
328 DWORD extraInfo
= queue
->GetMessageExtraInfoVal
;
329 queue
->GetMessageExtraInfoVal
= senderQ
->GetMessageExtraInfoVal
;
331 result
= CallWindowProc16( (WNDPROC16
)GetWindowLong16(senderQ
->hWnd
, GWL_WNDPROC
),
332 senderQ
->hWnd
, senderQ
->msg
, senderQ
->wParam
, senderQ
->lParam
);
334 queue
->GetMessageExtraInfoVal
= extraInfo
; /* Restore extra info */
335 dprintf_msg(stddeb
,"\trcm: result = %08x\n", (unsigned)result
);
337 else dprintf_msg(stddeb
,"\trcm: bad hWnd\n");
339 /* Return the result to the sender task */
340 ReplyMessage( result
);
342 queue
->InSendMessageHandle
= prevSender
;
343 queue
->smResultCurrent
= prevCtrlPtr
;
345 dprintf_msg(stddeb
,"ReceiveMessage: done!\n");
348 /***********************************************************************
351 * Try to reply to all pending sent messages on exit.
353 void QUEUE_FlushMessages( HQUEUE16 hQueue
)
355 MESSAGEQUEUE
*queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
);
359 MESSAGEQUEUE
*senderQ
= (MESSAGEQUEUE
*)GlobalLock16( queue
->hSendingTask
);
360 QSMCTRL
* CtrlPtr
= queue
->smResultCurrent
;
364 if( !(queue
->hSendingTask
= senderQ
->hPrevSendingTask
) )
365 queue
->wakeBits
&= ~QS_SENDMESSAGE
;
366 QUEUE_SetWakeBit( senderQ
, QS_SMPARAMSFREE
);
368 queue
->smResultCurrent
= CtrlPtr
;
369 while( senderQ
->wakeBits
& QS_SMRESULT
) OldYield();
371 senderQ
->SendMessageReturn
= 0;
372 senderQ
->smResult
= queue
->smResultCurrent
;
373 QUEUE_SetWakeBit( senderQ
, QS_SMRESULT
);
375 if( (senderQ
= (MESSAGEQUEUE
*)GlobalLock16( queue
->hSendingTask
)) )
376 CtrlPtr
= senderQ
->smResultInit
;
378 queue
->InSendMessageHandle
= 0;
382 /***********************************************************************
385 * Add a message to the queue. Return FALSE if queue is full.
387 BOOL32
QUEUE_AddMsg( HQUEUE16 hQueue
, MSG16
* msg
, DWORD extraInfo
)
390 MESSAGEQUEUE
*msgQueue
;
392 SIGNAL_MaskAsyncEvents( TRUE
);
394 if (!(msgQueue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
))) return FALSE
;
395 pos
= msgQueue
->nextFreeMessage
;
397 /* Check if queue is full */
398 if ((pos
== msgQueue
->nextMessage
) && (msgQueue
->msgCount
> 0))
400 SIGNAL_MaskAsyncEvents( FALSE
);
401 fprintf(stderr
,"MSG_AddMsg // queue is full !\n");
406 msgQueue
->messages
[pos
].msg
= *msg
;
407 msgQueue
->messages
[pos
].extraInfo
= extraInfo
;
408 if (pos
< msgQueue
->queueSize
-1) pos
++;
410 msgQueue
->nextFreeMessage
= pos
;
411 msgQueue
->msgCount
++;
413 SIGNAL_MaskAsyncEvents( FALSE
);
415 QUEUE_SetWakeBit( msgQueue
, QS_POSTMESSAGE
);
420 /***********************************************************************
423 * Find a message matching the given parameters. Return -1 if none available.
425 int QUEUE_FindMsg( MESSAGEQUEUE
* msgQueue
, HWND32 hwnd
, int first
, int last
)
427 int i
, pos
= msgQueue
->nextMessage
;
429 dprintf_msg(stddeb
,"QUEUE_FindMsg: hwnd=%04x pos=%d\n", hwnd
, pos
);
431 if (!msgQueue
->msgCount
) return -1;
432 if (!hwnd
&& !first
&& !last
) return pos
;
434 for (i
= 0; i
< msgQueue
->msgCount
; i
++)
436 MSG16
* msg
= &msgQueue
->messages
[pos
].msg
;
438 if (!hwnd
|| (msg
->hwnd
== hwnd
))
440 if (!first
&& !last
) return pos
;
441 if ((msg
->message
>= first
) && (msg
->message
<= last
)) return pos
;
443 if (pos
< msgQueue
->queueSize
-1) pos
++;
450 /***********************************************************************
453 * Remove a message from the queue (pos must be a valid position).
455 void QUEUE_RemoveMsg( MESSAGEQUEUE
* msgQueue
, int pos
)
457 SIGNAL_MaskAsyncEvents( TRUE
);
459 if (pos
>= msgQueue
->nextMessage
)
461 for ( ; pos
> msgQueue
->nextMessage
; pos
--)
462 msgQueue
->messages
[pos
] = msgQueue
->messages
[pos
-1];
463 msgQueue
->nextMessage
++;
464 if (msgQueue
->nextMessage
>= msgQueue
->queueSize
)
465 msgQueue
->nextMessage
= 0;
469 for ( ; pos
< msgQueue
->nextFreeMessage
; pos
++)
470 msgQueue
->messages
[pos
] = msgQueue
->messages
[pos
+1];
471 if (msgQueue
->nextFreeMessage
) msgQueue
->nextFreeMessage
--;
472 else msgQueue
->nextFreeMessage
= msgQueue
->queueSize
-1;
474 msgQueue
->msgCount
--;
475 if (!msgQueue
->msgCount
) msgQueue
->wakeBits
&= ~QS_POSTMESSAGE
;
477 SIGNAL_MaskAsyncEvents( FALSE
);
481 /***********************************************************************
484 * Wake a queue upon reception of a hardware event.
486 static void QUEUE_WakeSomeone( UINT message
)
491 MESSAGEQUEUE
*queue
= pCursorQueue
;
493 if( (message
>= WM_KEYFIRST
) && (message
<= WM_KEYLAST
) )
496 if( pActiveQueue
) queue
= pActiveQueue
;
500 wakeBit
= (message
== WM_MOUSEMOVE
) ? QS_MOUSEMOVE
: QS_MOUSEBUTTON
;
501 if( (hwnd
= GetCapture32()) )
502 if( (wndPtr
= WIN_FindWndPtr( hwnd
)) )
503 queue
= (MESSAGEQUEUE
*)GlobalLock16( wndPtr
->hmemTaskQ
);
506 if( (hwnd
= GetSysModalWindow16()) )
507 if( (wndPtr
= WIN_FindWndPtr( hwnd
)) )
508 queue
= (MESSAGEQUEUE
*)GlobalLock16( wndPtr
->hmemTaskQ
);
512 queue
= GlobalLock16( hFirstQueue
);
515 if (queue
->wakeMask
& wakeBit
) break;
516 queue
= GlobalLock16( queue
->next
);
520 dprintf_msg(stddeb
,"WakeSomeone: couldn't find queue\n");
525 QUEUE_SetWakeBit( queue
, wakeBit
);
529 /***********************************************************************
532 * Add an event to the system message queue.
533 * Note: the position is relative to the desktop window.
535 void hardware_event( WORD message
, WORD wParam
, LONG lParam
,
536 int xPos
, int yPos
, DWORD time
, DWORD extraInfo
)
541 if (!sysMsgQueue
) return;
542 pos
= sysMsgQueue
->nextFreeMessage
;
544 /* Merge with previous event if possible */
546 if ((message
== WM_MOUSEMOVE
) && sysMsgQueue
->msgCount
)
549 else pos
= sysMsgQueue
->queueSize
- 1;
550 msg
= &sysMsgQueue
->messages
[pos
].msg
;
551 if ((msg
->message
== message
) && (msg
->wParam
== wParam
))
552 sysMsgQueue
->msgCount
--; /* Merge events */
554 pos
= sysMsgQueue
->nextFreeMessage
; /* Don't merge */
557 /* Check if queue is full */
559 if ((pos
== sysMsgQueue
->nextMessage
) && sysMsgQueue
->msgCount
)
561 /* Queue is full, beep (but not on every mouse motion...) */
562 if (message
!= WM_MOUSEMOVE
) MessageBeep(0);
568 msg
= &sysMsgQueue
->messages
[pos
].msg
;
570 msg
->message
= message
;
571 msg
->wParam
= wParam
;
572 msg
->lParam
= lParam
;
574 msg
->pt
.x
= xPos
& 0xffff;
575 msg
->pt
.y
= yPos
& 0xffff;
576 sysMsgQueue
->messages
[pos
].extraInfo
= extraInfo
;
577 if (pos
< sysMsgQueue
->queueSize
- 1) pos
++;
579 sysMsgQueue
->nextFreeMessage
= pos
;
580 sysMsgQueue
->msgCount
++;
581 QUEUE_WakeSomeone( message
);
585 /***********************************************************************
588 HTASK16
QUEUE_GetQueueTask( HQUEUE16 hQueue
)
590 MESSAGEQUEUE
*queue
= GlobalLock16( hQueue
);
591 return (queue
) ? queue
->hTask
: 0 ;
595 /***********************************************************************
596 * QUEUE_IncPaintCount
598 void QUEUE_IncPaintCount( HQUEUE16 hQueue
)
602 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
))) return;
603 queue
->wPaintCount
++;
604 QUEUE_SetWakeBit( queue
, QS_PAINT
);
608 /***********************************************************************
609 * QUEUE_DecPaintCount
611 void QUEUE_DecPaintCount( HQUEUE16 hQueue
)
615 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
))) return;
616 queue
->wPaintCount
--;
617 if (!queue
->wPaintCount
) queue
->wakeBits
&= ~QS_PAINT
;
621 /***********************************************************************
622 * QUEUE_IncTimerCount
624 void QUEUE_IncTimerCount( HQUEUE16 hQueue
)
628 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
))) return;
629 queue
->wTimerCount
++;
630 QUEUE_SetWakeBit( queue
, QS_TIMER
);
634 /***********************************************************************
635 * QUEUE_DecTimerCount
637 void QUEUE_DecTimerCount( HQUEUE16 hQueue
)
641 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
))) return;
642 queue
->wTimerCount
--;
643 if (!queue
->wTimerCount
) queue
->wakeBits
&= ~QS_TIMER
;
647 /***********************************************************************
648 * PostQuitMessage (USER.6)
650 void PostQuitMessage( INT exitCode
)
654 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return;
655 queue
->wPostQMsg
= TRUE
;
656 queue
->wExitCode
= (WORD
)exitCode
;
660 /***********************************************************************
661 * GetWindowTask16 (USER.224)
663 HTASK16
GetWindowTask16( HWND16 hwnd
)
665 WND
*wndPtr
= WIN_FindWndPtr( hwnd
);
667 if (!wndPtr
) return 0;
668 return QUEUE_GetQueueTask( wndPtr
->hmemTaskQ
);
672 /***********************************************************************
673 * SetMessageQueue (USER.266)
675 BOOL
SetMessageQueue( int size
)
677 HQUEUE16 hQueue
, hNewQueue
;
678 MESSAGEQUEUE
*queuePtr
;
680 dprintf_msg(stddeb
,"SetMessageQueue: task %04x size %i\n", GetCurrentTask(), size
);
682 if ((size
> MAX_QUEUE_SIZE
) || (size
<= 0)) return TRUE
;
684 if( !(hNewQueue
= QUEUE_CreateMsgQueue( size
)))
686 dprintf_msg(stddeb
,"SetMessageQueue: failed!\n");
689 queuePtr
= (MESSAGEQUEUE
*)GlobalLock16( hNewQueue
);
691 SIGNAL_MaskAsyncEvents( TRUE
);
693 /* Copy data and free the old message queue */
694 if ((hQueue
= GetTaskQueue(0)) != 0)
696 MESSAGEQUEUE
*oldQ
= (MESSAGEQUEUE
*)GlobalLock16( hQueue
);
697 memcpy( &queuePtr
->reserved2
, &oldQ
->reserved2
,
698 (int)oldQ
->messages
- (int)(&oldQ
->reserved2
) );
699 HOOK_ResetQueueHooks( hNewQueue
);
700 if( WIN_GetDesktop()->hmemTaskQ
== hQueue
)
701 WIN_GetDesktop()->hmemTaskQ
= hNewQueue
;
702 WIN_ResetQueueWindows( WIN_GetDesktop()->child
, hQueue
, hNewQueue
);
703 QUEUE_DeleteMsgQueue( hQueue
);
706 /* Link new queue into list */
707 queuePtr
->hTask
= GetCurrentTask();
708 queuePtr
->next
= hFirstQueue
;
709 hFirstQueue
= hNewQueue
;
711 if( !queuePtr
->next
) pCursorQueue
= queuePtr
;
712 SetTaskQueue( 0, hNewQueue
);
714 SIGNAL_MaskAsyncEvents( FALSE
);
719 /***********************************************************************
720 * GetQueueStatus (USER.334)
722 DWORD
GetQueueStatus( UINT flags
)
727 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return 0;
728 ret
= MAKELONG( queue
->changeBits
, queue
->wakeBits
);
729 queue
->changeBits
= 0;
730 return ret
& MAKELONG( flags
, flags
);
734 /***********************************************************************
735 * GetInputState (USER.335)
741 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return FALSE
;
742 return queue
->wakeBits
& (QS_KEY
| QS_MOUSEBUTTON
);
746 /***********************************************************************
747 * GetMessagePos (USER.119)
749 DWORD
GetMessagePos(void)
753 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return 0;
754 return queue
->GetMessagePosVal
;
758 /***********************************************************************
759 * GetMessageTime (USER.120)
761 LONG
GetMessageTime(void)
765 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return 0;
766 return queue
->GetMessageTimeVal
;
770 /***********************************************************************
771 * GetMessageExtraInfo (USER.288)
773 LONG
GetMessageExtraInfo(void)
777 if (!(queue
= (MESSAGEQUEUE
*)GlobalLock16( GetTaskQueue(0) ))) return 0;
778 return queue
->GetMessageExtraInfoVal
;