2 * Message queues definitions
4 * Copyright 1993 Alexandre Julliard
17 /* Message as stored in the queue (contains the extraInfo field) */
18 typedef struct tagQMSG
20 int kind; /* message kind (sent,posted,hardware) */
23 DWORD extraInfo; /* Only in 3.1 */
29 #define QMSG_HARDWARE 3
32 /* Per-queue data for the message queue
33 * Note that we currently only store the current values for
34 * Active, Capture and Focus windows currently.
35 * It might be necessary to store a pointer to the system message queue
36 * as well since windows 9x maintains per thread system message queues
38 typedef struct tagPERQUEUEDATA
40 HWND hWndFocus; /* Focus window */
41 HWND hWndActive; /* Active window */
42 HWND hWndCapture; /* Capture window */
43 INT16 nCaptureHT; /* Capture info (hit-test) */
44 ULONG ulRefCount; /* Reference count */
45 CRITICAL_SECTION cSection; /* Critical section for thread safe access */
49 typedef struct tagMESSAGEQUEUE
51 HQUEUE16 self; /* Handle to self (was: reserved) */
52 TEB* teb; /* Thread owning queue */
53 HANDLE server_queue; /* Handle to server-side queue */
55 DWORD magic; /* magic number should be QUEUE_MAGIC */
56 DWORD lockCount; /* reference counter */
58 DWORD GetMessageTimeVal; /* Value for GetMessageTime */
59 DWORD GetMessagePosVal; /* Value for GetMessagePos */
60 DWORD GetMessageExtraInfoVal; /* Value for GetMessageExtraInfo */
62 HANDLE16 hCurHook; /* Current hook */
63 HANDLE16 hooks[WH_NB_HOOKS]; /* Task hooks list */
65 PERQUEUEDATA *pQData; /* pointer to (shared) PERQUEUEDATA structure */
70 #define QUEUE_MAGIC 0xD46E80AF
72 /* Per queue data management methods */
73 HWND PERQDATA_GetFocusWnd( PERQUEUEDATA *pQData );
74 HWND PERQDATA_SetFocusWnd( PERQUEUEDATA *pQData, HWND hWndFocus );
75 HWND PERQDATA_GetActiveWnd( PERQUEUEDATA *pQData );
76 HWND PERQDATA_SetActiveWnd( PERQUEUEDATA *pQData, HWND hWndActive );
77 HWND PERQDATA_GetCaptureWnd( INT *hittest );
78 HWND PERQDATA_SetCaptureWnd( HWND hWndCapture, INT hittest );
80 /* Message queue management methods */
81 extern MESSAGEQUEUE *QUEUE_Lock( HQUEUE16 hQueue );
82 extern void QUEUE_Unlock( MESSAGEQUEUE *queue );
83 extern BOOL QUEUE_IsExitingQueue( HQUEUE16 hQueue );
84 extern void QUEUE_SetExitingQueue( HQUEUE16 hQueue );
85 extern int QUEUE_WaitBits( WORD bits, DWORD timeout );
86 extern BOOL QUEUE_DeleteMsgQueue( HQUEUE16 hQueue );
87 extern HTASK16 QUEUE_GetQueueTask( HQUEUE16 hQueue );
88 extern BOOL QUEUE_FindMsg( HWND hwnd, UINT first, UINT last, BOOL remove, QMSG *msg );
89 extern void QUEUE_CleanupWindow( HWND hwnd );
91 extern HQUEUE16 WINAPI InitThreadInput16( WORD unknown, WORD flags );
93 #endif /* __WINE_QUEUE_H */