- Timestamp:
- Nov 2, 2009, 2:56:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/3rdparty/os2/xsystray/xsystray_api.c
r273 r276 20 20 #define INCL_WINATOM 21 21 #define INCL_WINPOINTERS 22 #define INCL_WINHOOKS 22 23 #include <os2.h> 23 24 … … 27 28 #include <string.h> 28 29 #include <sys/builtin.h> // atomics 30 31 static ULONG WM_XST_CREATED = 0; 32 // identity of the WM_XST_CREATED message taken from the atom table 33 static ULONG WM_XST_NOTIFY = 0; 34 // identity of the WM_XST_NOTIFY message taken from the atom table 29 35 30 36 static … … 170 176 171 177 /* 178 *@@ InputHook: 179 * This is used to intercept posted XST_NOTIFY messages and apply special 180 * processing to them (compose a client window-specific notification 181 * message, free the NOTIFYDATA structure and post the composed message to 182 * the target window). 183 */ 184 185 static BOOL EXPENTRY InputHook(HAB hab, PQMSG pQmsg, ULONG fs) 186 { 187 if (pQmsg->msg == WM_XST_NOTIFY) 188 { 189 PNOTIFYDATA pNotifyData = (PNOTIFYDATA)pQmsg->mp1; 190 PVOID pvMemoryPool = (PVOID)pQmsg->mp2; 191 192 // copy NOTIFYDATA and free it 193 NOTIFYDATA NotifyData = *pNotifyData; 194 FreeNotifyDataPtr(pvMemoryPool, pQmsg->hwnd, pNotifyData); 195 196 // start with a copy of the message and change the fields we need 197 QMSG newMsg = *pQmsg; 198 newMsg.msg = NotifyData.msg; 199 newMsg.mp1 = NotifyData.mp1; 200 newMsg.mp2 = NotifyData.mp2; 201 202 // deliver the message 203 WinDispatchMsg(hab, &newMsg); 204 205 return TRUE; 206 } 207 208 return FALSE; 209 } 210 211 /* 172 212 *@@ xstQuerySysTrayVersion: 173 213 * … … 262 302 return FALSE; 263 303 304 // install the message hook if not already done so 305 // @todo the code is temporary and incorrect, it's just for testing 306 // (we should use an array of HMQ to check if we already installed the filter) 307 if (WM_XST_NOTIFY == 0) 308 { 309 WM_XST_NOTIFY = WinAddAtom(WinQuerySystemAtomTable(), 310 WM_XST_NOTIFY_ATOM); 311 312 brc = WinSetHook(WinQueryAnchorBlock(hwnd), 313 HMQ_CURRENT, HK_INPUT, (PFN)InputHook, NULLHANDLE); 314 if (!brc) 315 return FALSE; 316 } 317 264 318 // give all processes temporary access to hIcon 265 319 brc = WinSetPointerOwner(hIcon, 0, FALSE); … … 400 454 ULONG xstGetSysTrayCreatedMsgId() 401 455 { 402 static ULONG WM_XST_CREATED = 0;403 456 if (WM_XST_CREATED == 0) 404 457 WM_XST_CREATED = WinAddAtom(WinQuerySystemAtomTable(),
Note:
See TracChangeset
for help on using the changeset viewer.