Changeset 5606 for trunk/src/user32/windowmsg.cpp
- Timestamp:
- Apr 27, 2001, 7:36:39 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/windowmsg.cpp
r5373 r5606 1 /* $Id: windowmsg.cpp,v 1.2 3 2001-03-25 08:50:42sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.24 2001-04-27 17:36:39 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 24 24 #include "oslibwin.h" 25 25 #include "oslibmsg.h" 26 #include "hook.h" 26 27 27 28 #define DBG_LOCALLOG DBG_windowmsg … … 39 40 LONG WIN32API DispatchMessageA(const MSG * msg) 40 41 { 42 dprintf2(("DispatchMessageA %x %x %x %x %x", msg->hwnd, msg->message, msg->wParam, msg->lParam, msg->time)); 41 43 return OSLibWinDispatchMsg((MSG *)msg); 42 44 } … … 45 47 LONG WIN32API DispatchMessageW( const MSG * msg) 46 48 { 49 dprintf2(("DispatchMessageW %x %x %x %x %x", msg->hwnd, msg->message, msg->wParam, msg->lParam, msg->time)); 47 50 return OSLibWinDispatchMsg((MSG *)msg, TRUE); 48 51 } … … 57 60 BOOL WIN32API GetMessageA( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax) 58 61 { 59 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax); 62 BOOL ret; 63 64 dprintf2(("GetMessageA %x %d-%d %d", hwnd, uMsgFilterMin, uMsgFilterMax)); 65 ret = OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax); 66 HOOK_CallHooksA(WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)pMsg); 67 return ret; 60 68 } 61 69 //****************************************************************************** … … 63 71 BOOL WIN32API GetMessageW( LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax) 64 72 { 65 return OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE); 73 BOOL ret; 74 75 dprintf2(("GetMessageW %x %d-%d %d", hwnd, uMsgFilterMin, uMsgFilterMax)); 76 ret = OSLibWinGetMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, TRUE); 77 HOOK_CallHooksW(WH_GETMESSAGE, HC_ACTION, PM_REMOVE, (LPARAM)pMsg); 78 return ret; 66 79 } 67 80 //****************************************************************************** … … 71 84 { 72 85 BOOL fFoundMsg; 73 86 87 dprintf2(("PeekMessagA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 74 88 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, 75 89 fuRemoveMsg, FALSE); 76 90 if(fFoundMsg) { 91 dprintf2(("PeekMessagA %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam)); 92 HOOK_CallHooksA(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg ); 77 93 if (msg->message == WM_QUIT && (fuRemoveMsg & PM_REMOVE)) { 78 94 //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down … … 88 104 BOOL fFoundMsg; 89 105 106 dprintf2(("PeekMessagW %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 90 107 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, 91 108 fuRemoveMsg, FALSE); 92 109 if(fFoundMsg) { 110 dprintf2(("PeekMessagW %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam)); 111 HOOK_CallHooksW(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg ); 93 112 if (msg->message == WM_QUIT && (fuRemoveMsg & (PM_REMOVE))) { 94 113 //TODO: Post WM_QUERYENDSESSION message when WM_QUIT received and system is shutting down … … 109 128 DWORD WIN32API GetMessagePos(void) 110 129 { 111 dprintf(("USER32: GetMessagePos")); 112 return OSLibWinGetMessagePos(); 130 DWORD pos; 131 132 pos = OSLibWinGetMessagePos(); 133 dprintf(("USER32: GetMessagePos -> (%d,%d)", HIWORD(pos), LOWORD(pos))); 134 return pos; 113 135 } 114 136 //****************************************************************************** … … 994 1016 DWORD queueStatus; 995 1017 996 dprintf(("USER32: GetQueueStatus"));997 1018 queueStatus = OSLibWinQueryQueueStatus(); 998 999 1019 queueStatus = MAKELONG(queueStatus, queueStatus); 1020 1021 dprintf(("USER32: GetQueueStatus %x returned %x", flags, queueStatus & MAKELONG(flags, flags))); 1022 1000 1023 return queueStatus & MAKELONG(flags, flags); 1001 1024 } … … 1032 1055 { 1033 1056 DWORD curtime, endtime; 1057 MSG msg; 1034 1058 1035 1059 dprintf(("MsgWaitForMultipleObjects %x %x %d %d %x", nCount, pHandles, fWaitAll, dwMilliseconds, dwWakeMask)); … … 1051 1075 if(OSLibWinWaitMessage() == FALSE) { 1052 1076 dprintf(("OSLibWinWaitMessage returned FALSE!")); 1053 return -1;1077 return WAIT_ABANDONED; 1054 1078 } 1055 1079 if(GetQueueStatus(dwWakeMask) != 0) { 1056 1080 return WAIT_OBJECT_0; 1057 1081 } 1082 //TODO: Ignoring all messages could be dangerous. But processing them, 1083 //while the app doesn't expect any, isn't safe either. 1084 if(PeekMessageA(&msg, NULL, 0, 0, PM_REMOVE)) 1085 { 1086 if (msg.message == WM_QUIT) { 1087 dprintf(("ERROR: MsgWaitForMultipleObjects call abandoned because WM_QUIT msg was received!!")); 1088 return WAIT_ABANDONED; 1089 } 1090 1091 /* otherwise dispatch it */ 1092 DispatchMessageA(&msg); 1093 } 1058 1094 curtime = GetCurrentTime(); 1059 1095 }
Note:
See TracChangeset
for help on using the changeset viewer.