Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

input.c File Reference

Go to the source code of this file.

Defines

#define CheckMsgRange(wMsgRangeMin, wMsgRangeMax, wMsgFilterMin, wMsgFilterMax)

Functions

UINT CalcWakeMask (UINT wMsgFilterMin, UINT wMsgFilterMax, UINT fsWakeMaskFilter)


Define Documentation

#define CheckMsgRange wMsgRangeMin,
wMsgRangeMax,
wMsgFilterMin,
wMsgFilterMax   ) 
 

Value:

( ((wMsgFilterMin) > (wMsgFilterMax)) \ ? ( ((wMsgRangeMax) > (wMsgFilterMax)) \ &&((wMsgRangeMin) < (wMsgFilterMin))) \ : ( ((wMsgRangeMax) >= (wMsgFilterMin)) \ &&((wMsgRangeMin) <= (wMsgFilterMax))) \ )

Definition at line 23 of file ntuser/rtl/input.c.

Referenced by CalcWakeMask().


Function Documentation

UINT CalcWakeMask UINT  wMsgFilterMin,
UINT  wMsgFilterMax,
UINT  fsWakeMaskFilter
 

Definition at line 43 of file ntuser/rtl/input.c.

References CheckMsgFilter, CheckMsgRange, FALSE, UINT, and WM_SYSTIMER.

Referenced by PeekMessage(), TransferWakeBit(), and xxxInternalGetMessage().

00047 { 00048 UINT fsWakeMask; 00049 00050 /* 00051 * New for NT5: wake mask filter. 00052 * In addition to the message filter, the application can also provide 00053 * a wake mask directly. 00054 * If none is provided, default to NT4 mask (plus QS_SENDMESSAGE). 00055 */ 00056 if (fsWakeMaskFilter == 0) { 00057 fsWakeMask = (QS_ALLINPUT | QS_EVENT | QS_ALLPOSTMESSAGE); 00058 } else { 00059 /* 00060 * If the caller wants input, we force all input events. The 00061 * same goes for posted messages. We do this to keep NT4 00062 * compatibility as much as possible. 00063 */ 00064 if (fsWakeMaskFilter & QS_INPUT) { 00065 fsWakeMaskFilter |= (QS_INPUT | QS_EVENT); 00066 } 00067 if (fsWakeMaskFilter & (QS_POSTMESSAGE | QS_TIMER | QS_HOTKEY)) { 00068 fsWakeMaskFilter |= (QS_POSTMESSAGE | QS_TIMER | QS_HOTKEY); 00069 } 00070 fsWakeMask = fsWakeMaskFilter; 00071 } 00072 00073 #ifndef _USERK_ 00074 /* 00075 * The client PeekMessage in client\cltxt.h didn't used to 00076 * call CalcWakeMask if wMsgFilterMax was 0. We call it now 00077 * to take care of fsWakeMaskFilter but still bail before 00078 * messing with the message filter. 00079 */ 00080 if (wMsgFilterMax == 0) { 00081 return fsWakeMask; 00082 } 00083 #endif 00084 00085 /* 00086 * Message filter. 00087 * If the filter doesn't match certain ranges, we take out bits one by one. 00088 * First check for a 0, 0 filter which means we want all input. 00089 */ 00090 if (wMsgFilterMin == 0 && wMsgFilterMax == ((UINT)-1)) { 00091 return fsWakeMask; 00092 } 00093 00094 /* 00095 * We're not looking at all posted messages. 00096 */ 00097 fsWakeMask &= ~QS_ALLPOSTMESSAGE; 00098 00099 /* 00100 * Check for mouse move messages. 00101 */ 00102 if ((CheckMsgFilter(WM_NCMOUSEMOVE, wMsgFilterMin, wMsgFilterMax) == FALSE) && 00103 (CheckMsgFilter(WM_MOUSEMOVE, wMsgFilterMin, wMsgFilterMax) == FALSE)) { 00104 fsWakeMask &= ~QS_MOUSEMOVE; 00105 } 00106 00107 /* 00108 * First check to see if mouse buttons messages are in the filter range. 00109 */ 00110 if ((CheckMsgRange(WM_NCLBUTTONDOWN, WM_NCMBUTTONDBLCLK, wMsgFilterMin, 00111 wMsgFilterMax) == FALSE) && (CheckMsgRange(WM_MOUSEFIRST + 1, 00112 WM_MOUSELAST, wMsgFilterMin, wMsgFilterMax) == FALSE)) { 00113 fsWakeMask &= ~QS_MOUSEBUTTON; 00114 } 00115 00116 /* 00117 * Check for key messages. 00118 */ 00119 if (CheckMsgRange(WM_KEYFIRST, WM_KEYLAST, 00120 wMsgFilterMin, wMsgFilterMax) == FALSE) { 00121 fsWakeMask &= ~QS_KEY; 00122 } 00123 00124 /* 00125 * Check for paint messages. 00126 */ 00127 if (CheckMsgFilter(WM_PAINT, wMsgFilterMin, wMsgFilterMax) == FALSE) { 00128 fsWakeMask &= ~QS_PAINT; 00129 } 00130 00131 /* 00132 * Check for timer messages. 00133 */ 00134 if ((CheckMsgFilter(WM_TIMER, wMsgFilterMin, wMsgFilterMax) == FALSE) && 00135 (CheckMsgFilter(WM_SYSTIMER, 00136 wMsgFilterMin, wMsgFilterMax) == FALSE)) { 00137 fsWakeMask &= ~QS_TIMER; 00138 } 00139 00140 /* 00141 * Check also for WM_QUEUESYNC which maps to all input bits. 00142 * This was added for CBT/EXCEL processing. Without it, a 00143 * xxxPeekMessage(.... WM_QUEUESYNC, WM_QUEUESYNC, FALSE) would 00144 * not see the message. (bobgu 4/7/87) 00145 * Since the user can provide a wake mask now (fsWakeMaskFilter), 00146 * we also add QS_EVENT in this case (it was always set on NT4). 00147 */ 00148 if (wMsgFilterMin == WM_QUEUESYNC) { 00149 fsWakeMask |= (QS_INPUT | QS_EVENT); 00150 } 00151 00152 return fsWakeMask; 00153 }


Generated on Sat May 15 19:44:13 2004 for test by doxygen 1.3.7