- Timestamp:
- May 25, 2001, 9:59:30 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsg.cpp
r5606 r5805 1 /* $Id: oslibmsg.cpp,v 1.3 7 2001-04-27 17:36:37sandervl Exp $ */1 /* $Id: oslibmsg.cpp,v 1.38 2001-05-25 19:59:29 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 128 128 129 129 if(msg >= WINWM_USER) 130 return WIN32APP_POSTMSG;130 return msg + WIN32APP_POSTMSG; 131 131 132 132 for(int i=0;i<MAX_MSGTRANSTAB;i++) … … 143 143 } 144 144 145 //not found, probaby WIN32APP_POSTMSG 146 return WIN32APP_POSTMSG; 145 //not found, get everything 146 dprintf(("WARNING: TranslateWinMsg: message %x not found", msg)); 147 return 0; 147 148 } 148 149 //****************************************************************************** … … 351 352 352 353 if(rc == FALSE) { 353 return FALSE;354 return FALSE; 354 355 } 355 356 … … 358 359 //unused PM message; dispatch immediately and grab next one 359 360 dprintf2(("OSLibWinPeekMsg: Untranslated message; dispatched immediately")); 360 rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE), 361 TranslateWinMsg(uMsgFilterMax, FALSE), PM_REMOVE); 361 if(!(fRemove & PM_REMOVE_W)) { 362 rc = WinPeekMsg(teb->o.odin.hab, &os2msg, hwndOS2, TranslateWinMsg(uMsgFilterMin, TRUE), 363 TranslateWinMsg(uMsgFilterMax, FALSE), PM_REMOVE); 364 } 362 365 WinDispatchMsg(teb->o.odin.hab, &os2msg); 363 366 return OSLibWinPeekMsg(pMsg, hwnd, uMsgFilterMin, uMsgFilterMax, … … 454 457 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 455 458 456 packet->Msg = msg; 457 packet->wParam = wParam; 458 packet->lParam = lParam; 459 460 return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet); 459 packet->wParam = wParam; 460 packet->lParam = lParam; 461 462 return (ULONG)WinSendMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet); 461 463 } 462 464 //****************************************************************************** … … 464 466 ULONG OSLibWinBroadcastMsg(ULONG msg, ULONG wParam, ULONG lParam, BOOL fSend) 465 467 { 466 return WinBroadcastMsg(HWND_DESKTOP, msg, (MPARAM)wParam, (MPARAM)lParam,468 return WinBroadcastMsg(HWND_DESKTOP, WIN32APP_POSTMSG+msg, (MPARAM)wParam, (MPARAM)lParam, 467 469 (fSend) ? BMSG_SEND : BMSG_POST); 468 470 } … … 473 475 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 474 476 475 packet->Msg = msg; 476 packet->wParam = wParam; 477 packet->lParam = lParam; 478 return WinPostMsg(hwnd, WIN32APP_POSTMSG, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet); 477 packet->wParam = wParam; 478 packet->lParam = lParam; 479 return WinPostMsg(hwnd, WIN32APP_POSTMSG+msg, (MPARAM)((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (MPARAM)packet); 479 480 } 480 481 //****************************************************************************** … … 509 510 // } 510 511 dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam)); 511 packet->Msg = msg; 512 packet->wParam = wParam; 513 packet->lParam = lParam; 514 return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet); 515 } 516 //****************************************************************************** 517 //****************************************************************************** 518 512 packet->wParam = wParam; 513 packet->lParam = lParam; 514 return O32_PostThreadMessage(threadid, WIN32APP_POSTMSG-OPEN32_MSGDIFF+msg, ((fUnicode) ? WIN32MSG_MAGICW : WIN32MSG_MAGICA), (LPARAM)packet); 515 } 516 //****************************************************************************** 517 //****************************************************************************** 518 -
trunk/src/user32/oslibmsgtranslate.cpp
r5713 r5805 1 /* $Id: oslibmsgtranslate.cpp,v 1.5 1 2001-05-15 14:31:38sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.52 2001-05-25 19:59:29 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 206 206 //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle 207 207 //Realplayer starts a timer with hwnd 0 & proc 0; check this here 208 if(win32wnd == 0 && (os2Msg->msg != WM_CREATE && os2Msg->msg != WM_QUIT && os2Msg->msg != WM_TIMER && os2Msg->msg !=WIN32APP_POSTMSG))208 if(win32wnd == 0 && (os2Msg->msg != WM_CREATE && os2Msg->msg != WM_QUIT && os2Msg->msg != WM_TIMER && os2Msg->msg < WIN32APP_POSTMSG)) 209 209 { 210 210 goto dummymessage; //not a win32 client window … … 218 218 winMsg->hwnd = win32wnd->getWindowHandle(); 219 219 220 switch(os2Msg->msg) 221 { 222 case WIN32APP_POSTMSG: 223 { 220 if(os2Msg->msg >= WIN32APP_POSTMSG) { 224 221 packet = (POSTMSG_PACKET *)os2Msg->mp2; 225 222 if(packet && ((ULONG)os2Msg->mp1 == WIN32MSG_MAGICA || (ULONG)os2Msg->mp1 == WIN32MSG_MAGICW)) { 226 winMsg->message = packet->Msg;223 winMsg->message = os2Msg->msg - WIN32APP_POSTMSG; 227 224 winMsg->wParam = packet->wParam; 228 225 winMsg->lParam = packet->lParam; 229 226 if(fMsgRemoved == MSG_REMOVE) free(packet); //free the shared memory here 230 break; 227 return TRUE; 228 } 229 else {//broadcasted message (no packet present) 230 winMsg->message = os2Msg->msg - WIN32APP_POSTMSG; 231 winMsg->wParam = (UINT)os2Msg->mp1; 232 winMsg->lParam = (DWORD)os2Msg->mp2; 233 return TRUE; 231 234 } 232 235 goto dummymessage; 233 236 } 234 237 238 switch(os2Msg->msg) 239 { 235 240 //OS/2 msgs 236 241 case WM_CREATE: -
trunk/src/user32/pmwindow.cpp
r5777 r5805 1 /* $Id: pmwindow.cpp,v 1.13 1 2001-05-22 09:33:12sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.132 2001-05-25 19:59:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 167 167 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 168 168 169 //// dprintf(("window %x msg %x", (win32wnd) ? win32wnd->getWindowHandle() : 0, msg)); 170 169 171 if(!teb || (msg != WM_CREATE && win32wnd == NULL)) { 170 172 dprintf(("OS2: Invalid win32wnd pointer for window %x msg %x", hwnd, msg)); … … 199 201 //NOTE-------------->>>>>> If this is changed, also change Win32WindowProc!! <<<<<<<<<<<-------------------- END 200 202 201 if(msg == WIN32APP_POSTMSG) {203 if(msg >= WIN32APP_POSTMSG) { 202 204 //probably win32 app user message 205 dprintf2(("Posted message %x->%x", msg, msg-WIN32APP_POSTMSG)); 203 206 if((ULONG)mp1 == WIN32MSG_MAGICA) { 204 207 rc = (MRESULT)win32wnd->DispatchMsgA(pWinMsg); … … 207 210 if((ULONG)mp1 == WIN32MSG_MAGICW) { 208 211 rc = (MRESULT)win32wnd->DispatchMsgW(pWinMsg); 212 } 213 else {//broadcasted message 214 rc = (MRESULT)win32wnd->DispatchMsgA(pWinMsg); 209 215 } 210 216 RestoreOS2TIB(); -
trunk/src/user32/win32wbase.h
r5685 r5805 1 /* $Id: win32wbase.h,v 1.11 6 2001-05-11 08:39:45sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.117 2001-05-25 19:59:30 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 55 55 //PM doesn't allow SetFocus during WM_SETFOCUS message processing; must delay 56 56 //this by posting a message 57 #define WIN32APP_SETFOCUSMSG (0x1001+OPEN32_MSGDIFF) 57 //NOTE Must be smaller than WIN32APP_POSTMSG! 58 #define WIN32APP_SETFOCUSMSG (WIN32APP_POSTMSG-1) 58 59 59 60 #define WIN32MSG_MAGICA 0x12345678 … … 62 63 typedef struct 63 64 { 64 ULONG Msg;65 65 ULONG wParam; 66 66 ULONG lParam; -
trunk/src/user32/windowmsg.cpp
r5606 r5805 1 /* $Id: windowmsg.cpp,v 1.2 4 2001-04-27 17:36:39sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.25 2001-05-25 19:59:30 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 … … 85 85 BOOL fFoundMsg; 86 86 87 dprintf2(("PeekMessag A %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));87 dprintf2(("PeekMessageA %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 88 88 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, 89 89 fuRemoveMsg, FALSE); 90 90 if(fFoundMsg) { 91 dprintf2(("PeekMessag A %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam));91 dprintf2(("PeekMessageA %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam)); 92 92 HOOK_CallHooksA(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg ); 93 93 if (msg->message == WM_QUIT && (fuRemoveMsg & PM_REMOVE)) { … … 104 104 BOOL fFoundMsg; 105 105 106 dprintf2(("PeekMessag W %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg));106 dprintf2(("PeekMessageW %x %d-%d %d", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg)); 107 107 fFoundMsg = OSLibWinPeekMsg(msg, hwndOwner, uMsgFilterMin, uMsgFilterMax, 108 108 fuRemoveMsg, FALSE); 109 109 if(fFoundMsg) { 110 dprintf2(("PeekMessag W %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam));110 dprintf2(("PeekMessageW %x %d-%d %d found message %x %d %x %x", hwndOwner, uMsgFilterMin, uMsgFilterMax, fuRemoveMsg, msg->hwnd, msg->message, msg->wParam, msg->lParam)); 111 111 HOOK_CallHooksW(WH_GETMESSAGE, HC_ACTION, fuRemoveMsg & PM_REMOVE, (LPARAM)msg ); 112 112 if (msg->message == WM_QUIT && (fuRemoveMsg & (PM_REMOVE))) { … … 1051 1051 /* Synchronization Functions */ 1052 1052 //****************************************************************************** 1053 DWORD MsgWaitForMultipleObjects(DWORD nCount, LPHANDLE pHandles, BOOL fWaitAll,1054 DWORD dwMilliseconds, DWORD dwWakeMask)1055 { 1056 DWORD curtime, endtime ;1053 DWORD WIN32API MsgWaitForMultipleObjects(DWORD nCount, LPHANDLE pHandles, BOOL fWaitAll, 1054 DWORD dwMilliseconds, DWORD dwWakeMask) 1055 { 1056 DWORD curtime, endtime, ret; 1057 1057 MSG msg; 1058 1058 … … 1097 1097 } 1098 1098 //SvL: Call handlemanager function as we need to translate handles 1099 return HMMsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask); 1100 } 1099 //TODO: doesn't work at all if waiting for message 1100 ret = HMMsgWaitForMultipleObjects(nCount,pHandles,fWaitAll,dwMilliseconds,dwWakeMask); 1101 return ret; 1102 }
Note:
See TracChangeset
for help on using the changeset viewer.