- Timestamp:
- Feb 5, 2002, 6:59:31 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r7627 r7801 1 # $Id: Makefile,v 1.9 8 2001-12-13 15:32:57sandervl Exp $1 # $Id: Makefile,v 1.99 2002-02-05 17:58:58 sandervl Exp $ 2 2 3 3 # … … 62 62 $(OBJDIR)\windowword.obj \ 63 63 $(OBJDIR)\windowmsg.obj \ 64 $(OBJDIR)\message.obj \ 64 65 $(OBJDIR)\winproc.obj \ 65 66 $(OBJDIR)\oslibmsg.obj \ -
trunk/src/user32/dbglocal.cpp
r6375 r7801 1 /* $Id: dbglocal.cpp,v 1. 7 2001-07-20 15:34:15sandervl Exp $ */1 /* $Id: dbglocal.cpp,v 1.8 2002-02-05 17:58:58 sandervl Exp $ */ 2 2 3 3 /* … … 88 88 "win32wbasenonclient", 89 89 "win32wbaseprop", 90 "dcrgn" 90 "dcrgn", 91 "message" 91 92 }; 92 93 //****************************************************************************** -
trunk/src/user32/dbglocal.h
r6375 r7801 1 /* $Id: dbglocal.h,v 1. 6 2001-07-20 15:34:15sandervl Exp $ */1 /* $Id: dbglocal.h,v 1.7 2002-02-05 17:58:59 sandervl Exp $ */ 2 2 3 3 /* … … 88 88 #define DBG_win32wbaseprop 66 89 89 #define DBG_dcrgn 67 90 #define DBG_MAXFILES 68 90 #define DBG_message 68 91 #define DBG_MAXFILES 69 91 92 92 93 extern USHORT DbgEnabledUSER32[DBG_MAXFILES]; -
trunk/src/user32/user32.cpp
r7691 r7801 1 /* $Id: user32.cpp,v 1.11 8 2001-12-26 19:05:35 achimhaExp $ */1 /* $Id: user32.cpp,v 1.119 2002-02-05 17:58:59 sandervl Exp $ */ 2 2 3 3 /* … … 1637 1637 dwDesiredAccess)); 1638 1638 1639 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1639 1640 return (NULL); 1640 1641 } … … 1670 1671 dwDesiredAccess)); 1671 1672 1673 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1672 1674 return (NULL); 1673 1675 } … … 1699 1701 dwDesiredAccess)); 1700 1702 1703 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1701 1704 return (NULL); 1702 1705 } … … 1727 1730 dwDesiredAccess)); 1728 1731 1732 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1729 1733 return (NULL); 1730 1734 } … … 1757 1761 dwDesiredAccess)); 1758 1762 1763 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1759 1764 return (NULL); 1760 1765 } … … 1781 1786 hWinSta)); 1782 1787 1788 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1783 1789 return (FALSE); 1784 1790 } … … 1803 1809 hDesktop)); 1804 1810 1811 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1805 1812 return (FALSE); 1806 1813 } … … 1833 1840 cbInfo)); 1834 1841 1842 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1835 1843 return (FALSE); 1836 1844 } … … 1863 1871 cbInfo)); 1864 1872 1873 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1865 1874 return (FALSE); 1866 1875 } … … 1890 1899 psd)); 1891 1900 1901 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1892 1902 return (FALSE); 1893 1903 } … … 1913 1923 hDesktop)); 1914 1924 1925 SetLastError(ERROR_CALL_NOT_IMPLEMENTED); 1915 1926 return (FALSE); 1916 1927 } -
trunk/src/user32/win32dlg.cpp
r7404 r7801 1 /* $Id: win32dlg.cpp,v 1.7 5 2001-11-20 15:25:18sandervl Exp $ */1 /* $Id: win32dlg.cpp,v 1.76 2002-02-05 17:59:00 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Dialog Code for OS/2 … … 79 79 } 80 80 81 dprintf(("Dialog style %x", LOWORD(dlgInfo.style))); 82 81 83 /* Create custom font if needed */ 82 84 if (dlgInfo.style & DS_SETFONT) … … 248 250 249 251 if (hUserFont) 250 Send InternalMessageA(WM_SETFONT, (WPARAM)hUserFont, 0 );252 SendMessageA(getWindowHandle(), WM_SETFONT, (WPARAM)hUserFont, 0 ); 251 253 252 254 /* Create controls */ … … 261 263 262 264 HWND hwndPreInitFocus = GetFocus(); 263 if(Send InternalMessageA(WM_INITDIALOG, (WPARAM)hwndFocus, param))265 if(SendMessageA(getWindowHandle(), WM_INITDIALOG, (WPARAM)hwndFocus, param)) 264 266 { 265 267 //SvL: Experiments in NT4 show that dialogs that are children don't … … 293 295 { 294 296 ShowWindow( SW_SHOWNORMAL ); /* SW_SHOW doesn't always work */ 295 UpdateWindow( getWindowHandle() ); 297 ////Note: this was removed in Wine 298 //// UpdateWindow( getWindowHandle() ); 296 299 } 297 300 SetLastError(ERROR_SUCCESS); … … 357 360 { 358 361 if(!(getStyle() & DS_NOIDLEMSG)) 359 topOwner->SendMessageA(WM_ENTERIDLE,MSGF_DIALOGBOX,getWindowHandle());362 SendMessageA(topOwner->getWindowHandle(), WM_ENTERIDLE,MSGF_DIALOGBOX,getWindowHandle()); 360 363 GetMessageA(&msg,0,0,0); 361 364 } … … 757 760 if ((rc == SIMPLEREGION) || (rc == COMPLEXREGION)) 758 761 { 759 HBRUSH hBrush = Send InternalMessageA(WM_CTLCOLORDLG, wParam, getWindowHandle());762 HBRUSH hBrush = SendMessageA(getWindowHandle(), WM_CTLCOLORDLG, wParam, getWindowHandle()); 760 763 if(GetObjectType(hBrush) != OBJ_BRUSH) { 761 764 DefWndControlColor(CTLCOLOR_DLG, (HDC)wParam); … … 855 858 /* always make combo box hide its listbox control */ 856 859 if( CONTROLS_IsControl( wndFocus, COMBOBOX_CONTROL ) ) 857 wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );860 SendMessageA(wndFocus->getWindowHandle(), CB_SHOWDROPDOWN, FALSE, 0 ); 858 861 else 859 862 if( CONTROLS_IsControl( wndFocus, EDIT_CONTROL ) && 860 863 CONTROLS_IsControl( wndFocus->getParent(), COMBOBOX_CONTROL )) 861 wndFocus->SendMessageA(CB_SHOWDROPDOWN, FALSE, 0 );864 SendMessageA(wndFocus->getWindowHandle(), CB_SHOWDROPDOWN, FALSE, 0 ); 862 865 RELEASE_WNDOBJ(wndFocus); 863 866 } -
trunk/src/user32/win32wbase.cpp
r7780 r7801 1 /* $Id: win32wbase.cpp,v 1.31 2 2002-01-20 15:26:21sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.313 2002-02-05 17:59:00 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 169 169 fIsModalDialogOwner = FALSE; 170 170 OS2HwndModalDialog = 0; 171 fInternalMsg = FALSE;172 171 fParentChange = FALSE; 173 172 fDestroyWindowCalled = FALSE; … … 212 211 hotkey = 0; 213 212 214 215 213 hwndLinkAfter = HWND_BOTTOM; 216 214 flags = 0; 217 lastHitTestVal = HT OS_NORMAL;215 lastHitTestVal = HTCLIENT; 218 216 owner = NULL; 219 217 windowClass = 0; … … 846 844 if(!(flags & WIN_NEED_SIZE)) 847 845 { 848 Send InternalMessageA(WM_SIZE, SIZE_RESTORED,849 850 846 SendMessageA(getWindowHandle(), WM_SIZE, SIZE_RESTORED, 847 MAKELONG(rectClient.right-rectClient.left, 848 rectClient.bottom-rectClient.top)); 851 849 852 850 if(!::IsWindow(hwnd)) … … 855 853 goto end; 856 854 } 857 Send InternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));855 SendMessageA(getWindowHandle(), WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 858 856 if(!::IsWindow(hwnd)) 859 857 { … … 883 881 if(getParent() && getParent()->IsWindowDestroyed() == FALSE) 884 882 { 885 getParent()->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());883 SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle()); 886 884 } 887 885 if(!::IsWindow(hwnd)) … … 914 912 ULONG Win32BaseWindow::MsgQuit() 915 913 { 916 return Send InternalMessageA(WM_QUIT, 0, 0);914 return SendMessageA(getWindowHandle(), WM_QUIT, 0, 0); 917 915 } 918 916 //****************************************************************************** … … 920 918 ULONG Win32BaseWindow::MsgClose() 921 919 { 922 return Send InternalMessageA(WM_CLOSE,0,0);920 return SendMessageA(getWindowHandle(), WM_CLOSE,0,0); 923 921 } 924 922 //****************************************************************************** … … 940 938 { 941 939 /* Notify the parent window only */ 942 getParent()->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());940 SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle()); 943 941 } 944 942 //// else DebugInt3(); 945 943 } 946 944 } 947 Send InternalMessageA(WM_DESTROY, 0, 0);945 SendMessageA(getWindowHandle(),WM_DESTROY, 0, 0); 948 946 if(::IsWindow(hwnd) == FALSE) { 949 947 //object already destroyed, so return immediately 950 948 return 1; 951 949 } 952 Send InternalMessageA(WM_NCDESTROY, 0, 0);950 SendMessageA(getWindowHandle(),WM_NCDESTROY, 0, 0); 953 951 954 952 TIMER_KillTimerFromWindow(getWindowHandle()); … … 979 977 else dwStyle |= WS_DISABLED; 980 978 981 return Send InternalMessageA(WM_ENABLE, fEnable, 0);979 return SendMessageA(getWindowHandle(),WM_ENABLE, fEnable, 0); 982 980 } 983 981 //****************************************************************************** … … 999 997 1000 998 //already sent from ShowWindow 1001 //// return Send InternalMessageA(WM_SHOWWINDOW, fShow, 0);999 //// return SendMessageA(getWindowHandle(),WM_SHOWWINDOW, fShow, 0); 1002 1000 return 0; 1003 1001 } … … 1011 1009 return 0; 1012 1010 1013 return Send InternalMessageA(WM_WINDOWPOSCHANGING, 0, lp);1011 return SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGING, 0, lp); 1014 1012 } 1015 1013 //****************************************************************************** … … 1022 1020 return 1; 1023 1021 1024 return Send InternalMessageA(WM_WINDOWPOSCHANGED, 0, lp);1022 return SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGED, 0, lp); 1025 1023 } 1026 1024 //****************************************************************************** … … 1030 1028 //According to the SDK docs, the scrollbar handle (lParam) is 0 when the standard 1031 1029 //window scrollbars send these messages 1032 return Send InternalMessageA(msg, MAKELONG(scrollCode, scrollPos), 0);1030 return SendMessageA(getWindowHandle(),msg, MAKELONG(scrollCode, scrollPos), 0); 1033 1031 } 1034 1032 //****************************************************************************** … … 1046 1044 //default processing is cancelled 1047 1045 //TODO: According to Wine we should proceed anyway if window is sysmodal 1048 if(Send InternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)1046 if(SendMessageA(getWindowHandle(),WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate) 1049 1047 { 1050 1048 dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing")); … … 1055 1053 { 1056 1054 if(fActivate) {//WM_CHILDACTIVE is for activation only 1057 Send InternalMessageA(WM_CHILDACTIVATE, 0, 0L);1055 SendMessageA(getWindowHandle(),WM_CHILDACTIVATE, 0, 0L); 1058 1056 } 1059 1057 return 0; 1060 1058 } 1061 1059 1062 return Send InternalMessageA(WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd);1060 return SendMessageA(getWindowHandle(),WM_ACTIVATE, MAKELONG((fActivate) ? WA_ACTIVE : WA_INACTIVE, fMinimized), hwnd); 1063 1061 } 1064 1062 //****************************************************************************** … … 1074 1072 //default processing is cancelled 1075 1073 //TODO: According to Wine we should proceed anyway if window is sysmodal 1076 if(Send InternalMessageA(WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate)1074 if(SendMessageA(getWindowHandle(),WM_NCACTIVATE, fActivate, 0) == FALSE && !fActivate) 1077 1075 { 1078 1076 dprintf(("WARNING: WM_NCACTIVATE return code = FALSE -> cancel processing")); … … 1083 1081 { 1084 1082 if(fActivate) {//WM_CHILDACTIVE is for activation only 1085 Send InternalMessageA(WM_CHILDACTIVATE, 0, 0L);1083 SendMessageA(getWindowHandle(),WM_CHILDACTIVATE, 0, 0L); 1086 1084 } 1087 1085 return 0; … … 1094 1092 ULONG Win32BaseWindow::DispatchMsgA(MSG *msg) 1095 1093 { 1096 return Send InternalMessageA(msg->message, msg->wParam, msg->lParam);1094 return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam); 1097 1095 } 1098 1096 //****************************************************************************** … … 1100 1098 ULONG Win32BaseWindow::DispatchMsgW(MSG *msg) 1101 1099 { 1102 return Send InternalMessageW(msg->message, msg->wParam, msg->lParam);1100 return SendMessageW(getWindowHandle(), msg->message, msg->wParam, msg->lParam); 1103 1101 } 1104 1102 //****************************************************************************** … … 1111 1109 } 1112 1110 1113 return SendInternalMessageA(WM_SETFOCUS, hwnd, 0);1111 return SendMessageA(getWindowHandle(),WM_SETFOCUS, hwnd, 0); 1114 1112 } 1115 1113 //****************************************************************************** … … 1121 1119 return 0; 1122 1120 } 1123 return Send InternalMessageA(WM_KILLFOCUS, hwnd, 0);1121 return SendMessageA(getWindowHandle(),WM_KILLFOCUS, hwnd, 0); 1124 1122 } 1125 1123 //****************************************************************************** … … 1130 1128 1131 1129 dprintf(("MsgButton %d at (%d,%d)", msg->message, msg->pt.x, msg->pt.y)); 1132 switch(msg->message) { 1130 switch(msg->message) 1131 { 1133 1132 case WM_LBUTTONDBLCLK: 1134 1133 case WM_RBUTTONDBLCLK: … … 1167 1166 if (hwndTop && (getWindowHandle() != hwndActive)) 1168 1167 { 1169 LONG ret = Send InternalMessageA(WM_MOUSEACTIVATE, hwndTop,1170 1168 LONG ret = SendMessageA(getWindowHandle(),WM_MOUSEACTIVATE, hwndTop, 1169 MAKELONG( lastHitTestVal, msg->message) ); 1171 1170 1172 1171 dprintf2(("WM_MOUSEACTIVATE returned %d", ret)); … … 1192 1191 } 1193 1192 1194 SendInternalMessageA(WM_SETCURSOR, getWindowHandle(), MAKELONG(lastHitTestVal, msg->message)); 1195 1196 return SendInternalMessageA(msg->message, msg->wParam, msg->lParam); 1193 SendMessageA(getWindowHandle(),WM_SETCURSOR, getWindowHandle(), MAKELONG(lastHitTestVal, msg->message)); 1194 1195 switch(msg->message) 1196 { 1197 case WM_LBUTTONDOWN: 1198 case WM_MBUTTONDOWN: 1199 case WM_RBUTTONDOWN: 1200 { 1201 if (getParent()) 1202 { 1203 POINTS pt = MAKEPOINTS(msg->lParam); 1204 POINT point; 1205 1206 point.x = pt.x; 1207 point.y = pt.y; 1208 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 1209 NotifyParent(msg->message, msg->wParam, MAKELPARAM(point.x,point.y)); 1210 } 1211 break; 1212 } 1213 } 1214 return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam); 1197 1215 } 1198 1216 //****************************************************************************** … … 1201 1219 { 1202 1220 if (select && IsWindowIconic()) 1203 return Send InternalMessageA(WM_PAINTICON, 1, 0);1221 return SendMessageA(getWindowHandle(),WM_PAINTICON, 1, 0); 1204 1222 else 1205 return Send InternalMessageA(WM_PAINT, 0, 0);1223 return SendMessageA(getWindowHandle(),WM_PAINT, 0, 0); 1206 1224 } 1207 1225 //****************************************************************************** … … 1218 1236 1219 1237 if(IsWindowIconic()) 1220 rc = Send InternalMessageA(WM_ICONERASEBKGND, hdcErase, 0);1238 rc = SendMessageA(getWindowHandle(),WM_ICONERASEBKGND, hdcErase, 0); 1221 1239 else 1222 rc = Send InternalMessageA(WM_ERASEBKGND, hdcErase, 0);1240 rc = SendMessageA(getWindowHandle(),WM_ERASEBKGND, hdcErase, 0); 1223 1241 if (hdc == 0) 1224 1242 ReleaseDC(getWindowHandle(), hdcErase); … … 1232 1250 //SDK: WM_SETCURSOR is not sent if the mouse is captured 1233 1251 if(GetCapture() == 0) { 1234 Send InternalMessageA(WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, msg->message));1252 SendMessageA(getWindowHandle(),WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, msg->message)); 1235 1253 } 1236 1254 1237 1255 //translated message == WM_(NC)MOUSEMOVE 1238 return Send InternalMessageA(msg->message, msg->wParam, msg->lParam);1256 return SendMessageA(getWindowHandle(),msg->message, msg->wParam, msg->lParam); 1239 1257 } 1240 1258 //****************************************************************************** … … 1264 1282 hrgn = CreateRectRgnIndirect(pUpdateRect); 1265 1283 1266 rc = Send InternalMessageA(WM_NCPAINT, hrgn, 0);1284 rc = SendMessageA(getWindowHandle(),WM_NCPAINT, hrgn, 0); 1267 1285 1268 1286 DeleteObject(hrgn); … … 1355 1373 ULONG Win32BaseWindow::MsgSetText(LPSTR lpsz, LONG cch) 1356 1374 { 1357 return Send InternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz);1375 return SendMessageA(getWindowHandle(),WM_SETTEXT, 0, (LPARAM)lpsz); 1358 1376 } 1359 1377 //****************************************************************************** … … 1361 1379 ULONG Win32BaseWindow::MsgGetTextLength() 1362 1380 { 1363 return Send InternalMessageA(WM_GETTEXTLENGTH, 0, 0);1381 return SendMessageA(getWindowHandle(),WM_GETTEXTLENGTH, 0, 0); 1364 1382 } 1365 1383 //****************************************************************************** … … 1367 1385 void Win32BaseWindow::MsgGetText(char *wndtext, ULONG textlength) 1368 1386 { 1369 Send InternalMessageA(WM_GETTEXT, textlength, (LPARAM)wndtext);1387 SendMessageA(getWindowHandle(),WM_GETTEXT, textlength, (LPARAM)wndtext); 1370 1388 } 1371 1389 //****************************************************************************** … … 1508 1526 */ 1509 1527 if ( uFlags & PRF_ERASEBKGND) 1510 Send InternalMessageA(WM_ERASEBKGND, (WPARAM)hdc, 0);1528 SendMessageA(getWindowHandle(),WM_ERASEBKGND, (WPARAM)hdc, 0); 1511 1529 1512 1530 /* … … 1514 1532 */ 1515 1533 if ( uFlags & PRF_CLIENT) 1516 Send InternalMessageA(WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT);1534 SendMessageA(getWindowHandle(),WM_PRINTCLIENT, (WPARAM)hdc, PRF_CLIENT); 1517 1535 1518 1536 … … 1644 1662 { 1645 1663 if(getParent()) { 1646 LRESULT rc = getParent()->SendInternalMessageA(WM_MOUSEACTIVATE, wParam, lParam );1664 LRESULT rc = SendMessageA(getParent()->getWindowHandle(), WM_MOUSEACTIVATE, wParam, lParam ); 1647 1665 if(rc) return rc; 1648 1666 } … … 1666 1684 { 1667 1685 if(getParent()) { 1668 LRESULT rc = getParent()->SendInternalMessageA(WM_SETCURSOR, wParam, lParam);1686 LRESULT rc = SendMessageA(getParent()->getWindowHandle(), WM_SETCURSOR, wParam, lParam); 1669 1687 if(rc) return rc; 1670 1688 } … … 1725 1743 if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE)) 1726 1744 { 1727 Send InternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left,rectClient.top));1745 SendMessageA(getWindowHandle(),WM_MOVE, 0, MAKELONG(rectClient.left,rectClient.top)); 1728 1746 } 1729 1747 if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE)) … … 1733 1751 if (dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED; 1734 1752 1735 Send InternalMessageA(WM_SIZE, wp, MAKELONG(rectClient.right - rectClient.left,1753 SendMessageA(getWindowHandle(),WM_SIZE, wp, MAKELONG(rectClient.right - rectClient.left, 1736 1754 rectClient.bottom - rectClient.top)); 1737 1755 } … … 1872 1890 else 1873 1891 if( wParam == VK_ESCAPE && (GetKeyState(VK_SHIFT) & 0x8000)) 1874 SendMessageW( WM_SYSCOMMAND, SC_KEYMENU, VK_SPACE );1892 SendMessageW(getWindowHandle(), WM_SYSCOMMAND, SC_KEYMENU, VK_SPACE ); 1875 1893 1876 1894 Win32BaseWindow *siblingWindow; … … 1904 1922 // key matches siblings mnemonic, send mouseclick 1905 1923 if (mnemonic == (char) wParam) { 1906 siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);1924 ::SendMessageA(siblingWindow->getWindowHandle(), BM_CLICK, 0, 0); 1907 1925 } 1908 1926 sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT); … … 1938 1956 ::SendMessageW(GetParent(), Msg, wParam, lParam ); 1939 1957 } 1940 else SendMessageA(WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam );1958 else ::SendMessageA(getWindowHandle(), WM_SYSCOMMAND, (WPARAM)SC_KEYMENU, (LPARAM)(DWORD)wParam ); 1941 1959 } 1942 1960 #if 0 … … 1956 1974 case WM_CONTEXTMENU: 1957 1975 if ((dwStyle & WS_CHILD) && getParent()) 1958 getParent()->SendInternalMessageA(WM_CONTEXTMENU,wParam,lParam);1976 SendMessageA(getParent()->getWindowHandle(), WM_CONTEXTMENU,wParam,lParam); 1959 1977 return 0; 1960 1978 … … 2029 2047 2030 2048 case WM_HELP: 2031 if (getParent()) getParent()->SendInternalMessageA(Msg,wParam,lParam);2049 if (getParent()) SendMessageA(getParent()->getWindowHandle(), Msg,wParam,lParam); 2032 2050 break; 2033 2051 … … 2121 2139 //****************************************************************************** 2122 2140 //****************************************************************************** 2123 LRESULT Win32BaseWindow::SendMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam)2124 {2125 //if the destination window is created by this process & thread, call window proc directly2126 if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) {2127 return SendInternalMessageA(Msg, wParam, lParam);2128 }2129 //otherwise use WinSendMsg to send it to the right process/thread2130 dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));2131 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);2132 }2133 //******************************************************************************2134 //******************************************************************************2135 LRESULT Win32BaseWindow::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)2136 {2137 //if the destination window is created by this process & thread, call window proc directly2138 if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) {2139 return SendInternalMessageW(Msg, wParam, lParam);2140 }2141 //otherwise use WinSendMsg to send it to the right process/thread2142 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, TRUE);2143 }2144 //******************************************************************************2145 //Called as a result of an OS/2 message or called from a class method2146 //******************************************************************************2147 LRESULT Win32BaseWindow::SendInternalMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam)2148 {2149 LRESULT rc;2150 HWND hwnd = getWindowHandle();2151 BOOL fInternalMsgBackup = fInternalMsg;2152 2153 //if the destination window was created by this process & thread, call window proc directly2154 if(dwProcessId != currentProcessId || dwThreadId != GetCurrentThreadId()) {2155 dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));2156 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);2157 }2158 2159 DebugPrintMessage(getWindowHandle(), Msg, wParam, lParam, FALSE, TRUE);2160 2161 CallWindowHookProc(WH_CALLWNDPROC, Msg, wParam, lParam, FALSE);2162 2163 fInternalMsg = TRUE;2164 switch(Msg)2165 {2166 case WM_CREATE:2167 {2168 if(CallWindowProcA(win32wndproc, getWindowHandle(), WM_CREATE, 0, lParam) == -1) {2169 dprintf(("WM_CREATE returned -1\n"));2170 rc = -1; //don't create window2171 break;2172 }2173 rc = 0;2174 break;2175 }2176 case WM_LBUTTONDOWN:2177 case WM_MBUTTONDOWN:2178 case WM_RBUTTONDOWN:2179 {2180 if (getParent())2181 {2182 POINTS pt = MAKEPOINTS(lParam);2183 POINT point;2184 2185 point.x = pt.x;2186 point.y = pt.y;2187 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);2188 NotifyParent(Msg,wParam,MAKELPARAM(point.x,point.y));2189 }2190 rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam);2191 break;2192 }2193 case WM_NCHITTEST:2194 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam);2195 break;2196 2197 case WM_DESTROY:2198 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);2199 break;2200 2201 default:2202 rc = CallWindowProcA(win32wndproc, getWindowHandle(), Msg, wParam, lParam);2203 break;2204 }2205 if(!::IsWindow(hwnd)) {2206 //window might have been destroyed by now. (this pointer invalid)2207 //we must return immediately2208 //(MS Visual C++ install heap corruption)2209 //TODO: could happen in several places here!!!!2210 return rc;2211 }2212 fInternalMsg = fInternalMsgBackup;2213 dprintf2(("SendMessageA %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));2214 return rc;2215 }2216 //******************************************************************************2217 //Called as a result of an OS/2 message or called from a class method2218 //******************************************************************************2219 LRESULT Win32BaseWindow::SendInternalMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam)2220 {2221 LRESULT rc;2222 HWND hwnd = getWindowHandle();2223 BOOL fInternalMsgBackup = fInternalMsg;2224 2225 //if the destination window was created by this process & thread, call window proc directly2226 if(dwProcessId != currentProcessId || dwThreadId != GetCurrentThreadId()) {2227 dprintf(("SendMessages (inter-process) %x %x %x %x", getWindowHandle(), Msg, wParam, lParam));2228 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE);2229 }2230 2231 DebugPrintMessage(getWindowHandle(), Msg, wParam, lParam, TRUE, TRUE);2232 2233 CallWindowHookProc(WH_CALLWNDPROC, Msg, wParam, lParam, TRUE);2234 2235 fInternalMsg = TRUE;2236 switch(Msg)2237 {2238 case WM_CREATE:2239 {2240 if(CallWindowProcW(win32wndproc, getWindowHandle(), WM_CREATE, 0, lParam) == -1) {2241 dprintf(("WM_CREATE returned -1\n"));2242 rc = -1; //don't create window2243 break;2244 }2245 rc = 0;2246 break;2247 }2248 case WM_LBUTTONDOWN:2249 case WM_MBUTTONDOWN:2250 case WM_RBUTTONDOWN:2251 NotifyParent(Msg, wParam, lParam);2252 rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam);2253 break;2254 2255 case WM_NCHITTEST:2256 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam);2257 break;2258 2259 case WM_DESTROY:2260 rc = win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);2261 break;2262 default:2263 rc = CallWindowProcW(win32wndproc, getWindowHandle(), Msg, wParam, lParam);2264 break;2265 }2266 if(!::IsWindow(hwnd)) {2267 //window might have been destroyed by now. (this pointer invalid)2268 //we must return immediately2269 //(MS Visual C++ install heap corruption)2270 //TODO: could happen in several places here!!!!2271 return rc;2272 }2273 fInternalMsg = fInternalMsgBackup;2274 dprintf2(("SendMessageW %x %x %x %x returned %x", getWindowHandle(), Msg, wParam, lParam, rc));2275 return rc;2276 }2277 //******************************************************************************2278 //******************************************************************************2279 void Win32BaseWindow::CallWindowHookProc(ULONG hooktype, ULONG Msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode)2280 {2281 CWPSTRUCT cwp;2282 2283 cwp.lParam = lParam;2284 cwp.wParam = wParam;2285 cwp.message = Msg;2286 cwp.hwnd = getWindowHandle();2287 2288 switch(hooktype) {2289 case WH_CALLWNDPROC:2290 if(fUnicode) {2291 HOOK_CallHooksW(WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp);2292 }2293 else HOOK_CallHooksA(WH_CALLWNDPROC, HC_ACTION, 1, (LPARAM)&cwp);2294 break;2295 }2296 }2297 //******************************************************************************2298 //TODO: Do this more efficiently2299 //******************************************************************************2300 LRESULT Win32BaseWindow::BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam)2301 {2302 Win32BaseWindow *window;2303 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD;2304 2305 dprintf(("BroadCastMessageA %x %x %x %s", msg, wParam, lParam, (type == BROADCAST_SEND) ? "Send" : "Post"));2306 2307 for(int i=0;i<MAX_WINDOW_HANDLES;i++) {2308 window = GetWindowFromHandle(hwnd++);2309 if(window) {2310 if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION))2311 {2312 if(type == BROADCAST_SEND) {2313 ::SendMessageA(window->getWindowHandle(), msg, wParam, lParam);2314 }2315 else PostMessageA(window->getWindowHandle(), msg, wParam, lParam);2316 }2317 RELEASE_WNDOBJ(window);2318 }2319 }2320 return 0;2321 }2322 //******************************************************************************2323 //TODO: Do this more efficiently2324 //******************************************************************************2325 LRESULT Win32BaseWindow::BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam)2326 {2327 Win32BaseWindow *window;2328 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD;2329 2330 dprintf(("BroadCastMessageW %x %x %x %s", msg, wParam, lParam, (type == BROADCAST_SEND) ? "Send" : "Post"));2331 2332 for(int i=0;i<MAX_WINDOW_HANDLES;i++) {2333 window = GetWindowFromHandle(hwnd++);2334 if(window) {2335 if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION))2336 {2337 if(type == BROADCAST_SEND) {2338 ::SendMessageW(window->getWindowHandle(), msg, wParam, lParam);2339 }2340 else PostMessageW(window->getWindowHandle(), msg, wParam, lParam);2341 }2342 RELEASE_WNDOBJ(window);2343 }2344 }2345 return 0;2346 }2347 //******************************************************************************2348 //******************************************************************************2349 2141 void Win32BaseWindow::NotifyParent(UINT Msg, WPARAM wParam, LPARAM lParam) 2350 2142 { … … 2359 2151 parentwindow = window->getParent(); 2360 2152 if(parentwindow) { 2361 parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), lParam );2153 SendMessageA(parentwindow->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(Msg, getWindowId()), lParam ); 2362 2154 } 2363 2155 } … … 2491 2283 if (showFlag != wasVisible) 2492 2284 { 2493 Send InternalMessageA(WM_SHOWWINDOW, showFlag, 0 );2285 SendMessageA(getWindowHandle(),WM_SHOWWINDOW, showFlag, 0 ); 2494 2286 if (!::IsWindow( getWindowHandle() )) goto END; 2495 2287 } … … 2517 2309 wParam = SIZE_MINIMIZED; 2518 2310 2519 Send InternalMessageA(WM_SIZE, wParam,2311 SendMessageA(getWindowHandle(),WM_SIZE, wParam, 2520 2312 MAKELONG(rectClient.right-rectClient.left, 2521 2313 rectClient.bottom-rectClient.top)); 2522 Send InternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));2314 SendMessageA(getWindowHandle(),WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 2523 2315 } 2524 2316 //testestest … … 2721 2513 rectWindow.top += dy; 2722 2514 rectWindow.bottom += dy; 2723 Send InternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top));2515 SendMessageA(getWindowHandle(),WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top)); 2724 2516 return TRUE; 2725 2517 } … … 2751 2543 WINDOWPOS wpOld = *wpos; 2752 2544 if(!(wpos->flags & SWP_NOSENDCHANGING)) 2753 Send InternalMessageA(WM_WINDOWPOSCHANGING, 0, (LPARAM)wpos);2545 SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGING, 0, (LPARAM)wpos); 2754 2546 2755 2547 if ((wpos->hwndInsertAfter != wpOld.hwndInsertAfter) || … … 2759 2551 SetWindowPos(wpos->hwndInsertAfter, wpos->x, wpos->y, wpos->cx, wpos->cy, wpos->flags | SWP_NOSENDCHANGING); 2760 2552 } 2761 else Send InternalMessageA(WM_WINDOWPOSCHANGED, 0, (LPARAM)wpos);2553 else SendMessageA(getWindowHandle(),WM_WINDOWPOSCHANGED, 0, (LPARAM)wpos); 2762 2554 2763 2555 //Calculate invalid areas … … 2882 2674 { 2883 2675 /* Notify the parent window only */ 2884 getParent()->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());2676 SendMessageA(getParent()->getWindowHandle(), WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle()); 2885 2677 if(!::IsWindow(hwnd) ) 2886 2678 { … … 2906 2698 if (NULL != owner) 2907 2699 { 2908 if (owner->getLastActive() == hwnd)2909 owner->setLastActive( owner->getWindowHandle() );2700 if (owner->getLastActive() == hwnd) 2701 owner->setLastActive( owner->getWindowHandle() ); 2910 2702 } 2911 2703 … … 3096 2888 //****************************************************************************** 3097 2889 //TODO: Should not enumerate children that are created during the enumeration! 2890 //TODO: Do this more efficiently 3098 2891 //****************************************************************************** 3099 2892 BOOL Win32BaseWindow::EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam) … … 3176 2969 BOOL Win32BaseWindow::EnumWindows(WNDENUMPROC lpfn, LPARAM lParam) 3177 2970 { 3178 Win32BaseWindow * child = 0;3179 BOOL rc;3180 HWND hwnd;2971 Win32BaseWindow *window; 2972 BOOL rc; 2973 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD; 3181 2974 3182 2975 dprintf(("EnumWindows %x %x", lpfn, lParam)); 3183 2976 3184 for (child = (Win32BaseWindow *)getFirstChild(); child; child = (Win32BaseWindow *)child->getNextChild()) 3185 { 3186 hwnd = child->getWindowHandle(); 3187 3188 dprintf2(("EnumWindows: Found Window %x", child->getWindowHandle())); 3189 if((rc = lpfn(child->getWindowHandle(), lParam)) == FALSE) { 3190 break; 3191 } 3192 } 2977 for(int i=0;i<MAX_WINDOW_HANDLES;i++) 2978 { 2979 window = GetWindowFromHandle(hwnd++); 2980 if(window) 2981 { 2982 if ((window->getStyle() & WS_POPUP) || ((window->getStyle() & WS_CAPTION) == WS_CAPTION)) 2983 { 2984 dprintf2(("EnumWindows: Found Window %x", window->getWindowHandle())); 2985 if((rc = lpfn(window->getWindowHandle(), lParam)) == FALSE) { 2986 break; 2987 } 2988 } 2989 RELEASE_WNDOBJ(window); 2990 } 2991 } 2992 if(window) RELEASE_WNDOBJ(window); 3193 2993 return TRUE; 3194 2994 } … … 3523 3323 rc = (getStyle() & WS_DISABLED) != 0; 3524 3324 if(rc && !fEnable) { 3525 SendMessageA( WM_CANCELMODE, 0, 0);3325 SendMessageA(getWindowHandle(), WM_CANCELMODE, 0, 0); 3526 3326 } 3527 3327 OSLibWinEnableWindow(OS2HwndFrame, fEnable); … … 3624 3424 { 3625 3425 //if the destination window is created by this process, send message 3626 if(dwProcessId == currentProcessId) { 3426 if(dwProcessId == currentProcessId) 3427 { 3627 3428 if(fUnicode) { 3628 return Send InternalMessageW(WM_GETTEXTLENGTH,0,0);3629 } 3630 else return Send InternalMessageA(WM_GETTEXTLENGTH,0,0);3429 return SendMessageW(getWindowHandle(), WM_GETTEXTLENGTH,0,0); 3430 } 3431 else return SendMessageA(getWindowHandle(), WM_GETTEXTLENGTH,0,0); 3631 3432 } 3632 3433 //else get data directory from window structure … … 3642 3443 //if the destination window is created by this process, send message 3643 3444 if(dwProcessId == currentProcessId) { 3644 return Send InternalMessageA(WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);3445 return SendMessageA(getWindowHandle(),WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz); 3645 3446 } 3646 3447 … … 3659 3460 //if the destination window is created by this process, send message 3660 3461 if(dwProcessId == currentProcessId) { 3661 return SendInternalMessageW(WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz);3462 return ::SendMessageW(getWindowHandle(), WM_GETTEXT,(WPARAM)cch,(LPARAM)lpsz); 3662 3463 } 3663 3464 //else get data directory from window structure 3664 if (!lpsz || !cch)3665 return 0;3666 if (!windowNameW)3667 lpsz[0] = 0;3668 else3669 memcpy(lpsz, windowNameW, min( sizeof(WCHAR) * (windowNameLength+1), cch));3465 if (!lpsz || !cch) 3466 return 0; 3467 if (!windowNameW) 3468 lpsz[0] = 0; 3469 else 3470 memcpy(lpsz, windowNameW, min( sizeof(WCHAR) * (windowNameLength+1), cch)); 3670 3471 3671 return min(windowNameLength, cch);3472 return min(windowNameLength, cch); 3672 3473 } 3673 3474 //****************************************************************************** … … 3676 3477 BOOL Win32BaseWindow::SetWindowTextA(LPSTR lpsz) 3677 3478 { 3678 return Send InternalMessageA(WM_SETTEXT,0,(LPARAM)lpsz);3479 return SendMessageA(getWindowHandle(),WM_SETTEXT,0,(LPARAM)lpsz); 3679 3480 } 3680 3481 //****************************************************************************** … … 3682 3483 BOOL Win32BaseWindow::SetWindowTextW(LPWSTR lpsz) 3683 3484 { 3684 return Send InternalMessageW(WM_SETTEXT,0,(LPARAM)lpsz);3485 return SendMessageW(getWindowHandle(), WM_SETTEXT,0,(LPARAM)lpsz); 3685 3486 } 3686 3487 //****************************************************************************** … … 3702 3503 ss.styleNew = value; 3703 3504 dprintf(("SetWindowLong GWL_EXSTYLE %x old %x new style %x", getWindowHandle(), dwExStyle, value)); 3704 Send InternalMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss);3505 SendMessageA(getWindowHandle(),WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss); 3705 3506 setExStyle(ss.styleNew); 3706 Send InternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss);3507 SendMessageA(getWindowHandle(),WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss); 3707 3508 oldval = ss.styleOld; 3708 3509 break; … … 3727 3528 ss.styleOld = getStyle(); 3728 3529 ss.styleNew = value | (ss.styleOld & WS_CHILD); 3729 Send InternalMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss);3530 SendMessageA(getWindowHandle(),WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); 3730 3531 setStyle(ss.styleNew); 3731 Send InternalMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss);3532 SendMessageA(getWindowHandle(),WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss); 3732 3533 OSLibSetWindowStyle(getOS2FrameWindowHandle(), getOS2WindowHandle(), getStyle(), getExStyle()); 3733 3534 -
trunk/src/user32/win32wbase.h
r7765 r7801 1 /* $Id: win32wbase.h,v 1.13 8 2002-01-12 14:09:31 sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.139 2002-02-05 17:59:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 82 82 ULONG lParam; 83 83 } POSTMSG_PACKET; 84 85 #define BROADCAST_SEND 086 #define BROADCAST_POST 187 84 88 85 #define HAS_DLGFRAME(style,exStyle) \ … … 190 187 191 188 LONG getLastHitTestVal() { return lastHitTestVal; } 189 void setLastHitTestVal(LONG hittest) { lastHitTestVal = hittest; } 192 190 193 191 DWORD getWindowContextHelpId() { return contextHelpId; }; … … 323 321 SCROLLBAR_INFO *getScrollInfo(int nBar); 324 322 325 LRESULT SendMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);326 LRESULT SendMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);327 static LRESULT BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam);328 static LRESULT BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam);329 void CallWindowHookProc(ULONG hooktype, ULONG Msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode = FALSE);330 331 323 LRESULT DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam); 332 324 LRESULT DefWindowProcW(UINT msg, WPARAM wParam, LPARAM lParam); … … 374 366 BOOL CreateWindowExA(CREATESTRUCTA *lpCreateStruct, ATOM classAtom); 375 367 #endif 376 LRESULT SendInternalMessageA(ULONG msg, WPARAM wParam, LPARAM lParam);377 LRESULT SendInternalMessageW(ULONG msg, WPARAM wParam, LPARAM lParam);378 368 void Init(); 379 369 … … 417 407 fIsModalDialog:1, 418 408 fIsModalDialogOwner:1, 419 fInternalMsg:1, //Used to distinguish between messages420 //sent by PM and those sent by apps421 409 fParentChange:1, 422 410 fDestroyWindowCalled:1, //DestroyWindow was called for this window -
trunk/src/user32/win32wbasenonclient.cpp
r7063 r7801 1 /* $Id: win32wbasenonclient.cpp,v 1.3 7 2001-10-15 17:09:04sandervl Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.38 2002-02-05 17:59:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 155 155 156 156 if (wParam == HTMINBUTTON) 157 Send InternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,*(LPARAM*)&msg.pt);157 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MINIMIZE,*(LPARAM*)&msg.pt); 158 158 else if (wParam == HTMAXBUTTON) 159 Send InternalMessageA(WM_SYSCOMMAND,IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt);159 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,IsZoomed(Win32Hwnd) ? SC_RESTORE:SC_MAXIMIZE,*(LPARAM*)&msg.pt); 160 160 else 161 Send InternalMessageA(WM_SYSCOMMAND,SC_CONTEXTHELP,*(LPARAM*)&msg.pt);161 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CONTEXTHELP,*(LPARAM*)&msg.pt); 162 162 } 163 163 //****************************************************************************** … … 192 192 ReleaseDC(Win32Hwnd,hdc); 193 193 if (!pressed) return; 194 Send InternalMessageA(WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt);194 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt); 195 195 } 196 196 //****************************************************************************** … … 273 273 } 274 274 if (GetActiveWindow() == hwndTopParent) 275 Send InternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);275 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam); 276 276 else dprintf(("ACtive window (%x) != toplevel wnd %x", OSLibWinQueryActiveWindow(), hwndTopParent)); 277 277 } … … 279 279 SetActiveWindow(); 280 280 if (GetActiveWindow() == hwndTopParent) 281 Send InternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);281 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam); 282 282 else dprintf(("ACtive window (%x) != wnd %x", OSLibWinQueryActiveWindow(), getWindowHandle())); 283 283 } … … 288 288 if(dwStyle & WS_SYSMENU ) 289 289 { 290 Send InternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam);290 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU+HTSYSMENU,lParam); 291 291 } 292 292 break; 293 293 294 294 case HTMENU: 295 Send InternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU,lParam);295 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU,lParam); 296 296 break; 297 297 298 298 case HTHSCROLL: 299 Send InternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);299 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam); 300 300 break; 301 301 302 302 case HTVSCROLL: 303 Send InternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);303 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam); 304 304 break; 305 305 … … 323 323 case HTBOTTOMRIGHT: 324 324 /* make sure hittest fits into 0xf and doesn't overlap with HTSYSMENU */ 325 Send InternalMessageA(WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam);325 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_SIZE+wParam-2,lParam); 326 326 break; 327 327 case HTBORDER: … … 1207 1207 if (dwStyle & WS_MINIMIZE) 1208 1208 { 1209 Send InternalMessageA(WM_SYSCOMMAND,SC_RESTORE,lParam);1209 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_RESTORE,lParam); 1210 1210 return 0; 1211 1211 } … … 1216 1216 /* stop processing if WS_MAXIMIZEBOX is missing */ 1217 1217 if (dwStyle & WS_MAXIMIZEBOX) 1218 Send InternalMessageA(WM_SYSCOMMAND,1218 SendMessageA(getWindowHandle(), WM_SYSCOMMAND, 1219 1219 (dwStyle & WS_MAXIMIZE) ? SC_RESTORE : SC_MAXIMIZE, 1220 1220 lParam); … … 1223 1223 case HTSYSMENU: 1224 1224 if (!(GetClassWord(Win32Hwnd,GCW_STYLE) & CS_NOCLOSE)) 1225 Send InternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);1225 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_CLOSE,lParam); 1226 1226 break; 1227 1227 1228 1228 case HTHSCROLL: 1229 Send InternalMessageA(WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam);1229 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_HSCROLL+HTHSCROLL,lParam); 1230 1230 break; 1231 1231 1232 1232 case HTVSCROLL: 1233 Send InternalMessageA(WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam);1233 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_VSCROLL+HTVSCROLL,lParam); 1234 1234 break; 1235 1235 } … … 1249 1249 if (((GetActiveWindow() == Win32Hwnd) || isMDIChild()) && (dwStyle & WS_SYSMENU)) 1250 1250 { 1251 Send InternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam);1251 SendMessageA(getWindowHandle(), WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam); 1252 1252 } 1253 1253 break; … … 1345 1345 1346 1346 case SC_CLOSE: 1347 return Send InternalMessageA(WM_CLOSE,0,0);1347 return SendMessageA(getWindowHandle(), WM_CLOSE,0,0); 1348 1348 1349 1349 case SC_CONTEXTHELP: -
trunk/src/user32/win32wbasepos.cpp
r5935 r7801 1 /* $Id: win32wbasepos.cpp,v 1.2 6 2001-06-09 14:50:22sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.27 2002-02-05 17:59:01 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 115 115 // } 116 116 117 Send InternalMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );117 SendMessageA(getWindowHandle(), WM_GETMINMAXINFO, 0, (LPARAM)&MinMax ); 118 118 119 119 /* Some sanity checks */ … … 163 163 params.lppos = &winposCopy; 164 164 } 165 result = Send InternalMessageA(WM_NCCALCSIZE, calcValidRect, (LPARAM)¶ms );165 result = SendMessageA(getWindowHandle(), WM_NCCALCSIZE, calcValidRect, (LPARAM)¶ms ); 166 166 167 167 /* If the application send back garbage, ignore it */ … … 293 293 if(getStyle() & WS_MINIMIZE ) 294 294 { 295 if(!Send InternalMessageA(WM_QUERYOPEN, 0, 0L))295 if(!SendMessageA(getWindowHandle(), WM_QUERYOPEN, 0, 0L)) 296 296 return (SWP_NOSIZE | SWP_NOMOVE); 297 297 } -
trunk/src/user32/windowmsg.cpp
r7667 r7801 1 /* $Id: windowmsg.cpp,v 1.3 2 2001-12-21 18:43:59sandervl Exp $ */1 /* $Id: windowmsg.cpp,v 1.33 2002-02-05 17:59:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window message APIs for OS/2 4 4 * 5 * Copyright 1999 Sander van Leeuwen5 * Copyright 1999-2001 Sander van Leeuwen 6 6 * 7 7 * Parts based on Wine Windows code (windows\message.c) 990508 … … 37 37 38 38 39 //******************************************************************************40 //******************************************************************************41 VOID WIN32API PostQuitMessage( int nExitCode)42 {43 dprintf(("USER32: PostQuitMessage\n"));44 OSLibWinPostQuitMessage(nExitCode);45 }46 39 //****************************************************************************** 47 40 //****************************************************************************** … … 172 165 //****************************************************************************** 173 166 //****************************************************************************** 174 LRESULT WIN32API SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)175 {176 Win32BaseWindow *window;177 LRESULT result;178 179 if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)180 {181 Win32BaseWindow::BroadcastMessageA(BROADCAST_SEND, msg, wParam, lParam);182 return TRUE;183 }184 185 window = Win32BaseWindow::GetWindowFromHandle(hwnd);186 if(!window) {187 dprintf(("SendMessageA, %x %x %x window %x not found", msg, wParam, lParam, hwnd));188 return 0;189 }190 result = window->SendMessageA(msg, wParam, lParam);191 RELEASE_WNDOBJ(window);192 return result;193 }194 //******************************************************************************195 //******************************************************************************196 LRESULT WIN32API SendMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)197 {198 Win32BaseWindow *window;199 LRESULT result;200 201 if (hwnd == HWND_BROADCAST|| hwnd == HWND_TOPMOST)202 {203 Win32BaseWindow::BroadcastMessageW(BROADCAST_SEND, msg, wParam, lParam);204 return TRUE;205 }206 207 window = Win32BaseWindow::GetWindowFromHandle(hwnd);208 if(!window) {209 dprintf(("SendMessageW, window %x not found", hwnd));210 return 0;211 }212 result = window->SendMessageW(msg, wParam, lParam);213 RELEASE_WNDOBJ(window);214 return result;215 }216 //******************************************************************************217 //******************************************************************************218 BOOL WIN32API PostMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)219 {220 Win32BaseWindow *window;221 HWND hwndOS2;222 223 if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???224 {225 Win32BaseWindow::BroadcastMessageA(BROADCAST_POST, msg, wParam, lParam);226 return TRUE;227 }228 229 if(hwnd == NULL)230 return PostThreadMessageA(GetCurrentThreadId(), msg, wParam, lParam);231 232 window = Win32BaseWindow::GetWindowFromHandle(hwnd);233 if(!window) {234 dprintf(("PostMessageA, window %x not found", hwnd));235 return FALSE;236 }237 hwndOS2 = window->getOS2WindowHandle();238 RELEASE_WNDOBJ(window);239 dprintf(("PostMessageA, %x %x %x %x", hwnd, msg, wParam, lParam));240 return OSLibPostMessage(hwndOS2, msg, wParam, lParam, FALSE);241 }242 //******************************************************************************243 //******************************************************************************244 BOOL WIN32API PostMessageW(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)245 {246 Win32BaseWindow *window;247 HWND hwndOS2;248 249 if (hwnd == HWND_BROADCAST) //Not HWND_TOPMOST???250 {251 Win32BaseWindow::BroadcastMessageW(BROADCAST_POST, msg, wParam, lParam);252 return TRUE;253 }254 255 if(hwnd == NULL)256 return PostThreadMessageW(GetCurrentThreadId(), msg, wParam, lParam);257 258 window = Win32BaseWindow::GetWindowFromHandle(hwnd);259 if(!window) {260 dprintf(("PostMessageW, window %x not found", hwnd));261 return FALSE;262 }263 hwndOS2 = window->getOS2WindowHandle();264 RELEASE_WNDOBJ(window);265 dprintf(("PostMessageW, %x %x %x %x", hwnd, msg, wParam, lParam));266 return OSLibPostMessage(hwndOS2, msg, wParam, lParam, TRUE);267 }268 //******************************************************************************269 //******************************************************************************270 BOOL WIN32API PostThreadMessageA( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)271 {272 return OSLibPostThreadMessage(threadid, msg, wParam, lParam, FALSE);273 }274 //******************************************************************************275 //******************************************************************************276 BOOL WIN32API PostThreadMessageW( DWORD threadid, UINT msg, WPARAM wParam, LPARAM lParam)277 {278 return OSLibPostThreadMessage(threadid, msg, wParam, lParam, TRUE);279 }280 //******************************************************************************281 //******************************************************************************282 167 BOOL WIN32API WaitMessage(void) 283 168 { … … 298 183 dprintf(("USER32: ReplyMessage %x", result)); 299 184 return OSLibWinReplyMessage(result); 185 } 186 //****************************************************************************** 187 //****************************************************************************** 188 VOID WIN32API PostQuitMessage( int nExitCode) 189 { 190 dprintf(("USER32: PostQuitMessage\n")); 191 OSLibWinPostQuitMessage(nExitCode); 300 192 } 301 193 //****************************************************************************** … … 323 215 dprintf(("USER32: SetMessageQueue\n")); 324 216 return(TRUE); 325 }326 //******************************************************************************327 //******************************************************************************328 LRESULT WIN32API SendMessageTimeoutA(HWND hwnd, UINT Msg, WPARAM wParam,329 LPARAM lParam, UINT fuFlags, UINT uTimeOut,330 LPDWORD lpdwResult)331 {332 dprintf(("USER32: SendMessageTimeoutA, partially implemented\n"));333 //ignore fuFlags & wTimeOut334 *lpdwResult = SendMessageA(hwnd, Msg, wParam, lParam);335 return(TRUE);336 }337 //******************************************************************************338 //******************************************************************************339 LRESULT WIN32API SendMessageTimeoutW(HWND hwnd, UINT Msg, WPARAM wParam,340 LPARAM lParam, UINT fuFlags, UINT uTimeOut,341 LPDWORD lpdwResult)342 {343 dprintf(("USER32: SendMessageTimeoutW, partially implemented\n"));344 return(SendMessageTimeoutA(hwnd, Msg, wParam, lParam, fuFlags, uTimeOut, lpdwResult));345 }346 //******************************************************************************347 //******************************************************************************348 BOOL WIN32API SendNotifyMessageA(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)349 {350 dprintf(("USER32: SendNotifyMessageA, not completely implemented\n"));351 return(SendMessageA(hwnd, Msg, wParam, lParam));352 }353 //******************************************************************************354 //******************************************************************************355 BOOL WIN32API SendNotifyMessageW(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam)356 {357 dprintf(("USER32: SendNotifyMessageW, not completely implemented\n"));358 return(SendMessageA(hwnd, Msg, wParam, lParam));359 }360 /*****************************************************************************361 * Name : BOOL WIN32API SendMessageCallbackA362 * Purpose : The SendMessageCallback function sends the specified message to363 * a window or windows. The function calls the window procedure for364 * the specified window and returns immediately. After the window365 * procedure processes the message, the system calls the specified366 * callback function, passing the result of the message processing367 * and an application-defined value to the callback function.368 * Parameters: HWND hwnd handle of destination window369 * UINT uMsg message to send370 * WPARAM wParam first message parameter371 * LPARAM lParam second message parameter372 * SENDASYNCPROC lpResultCallBack function to receive message value373 * DWORD dwData value to pass to callback function374 * Variables :375 * Result : If the function succeeds, the return value is TRUE.376 * If the function fails, the return value is FALSE. To get extended377 * error information, call GetLastError.378 * Remark :379 * Status : UNTESTED STUB380 *381 * Author : Patrick Haller [Thu, 1998/02/26 11:55]382 *****************************************************************************/383 384 BOOL WIN32API SendMessageCallbackA(HWND hWnd,385 UINT uMsg,386 WPARAM wParam,387 LPARAM lParam,388 SENDASYNCPROC lpResultCallBack,389 DWORD dwData)390 {391 dprintf(("USER32:SendMessageCallBackA (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",392 hWnd,393 uMsg,394 wParam,395 lParam,396 lpResultCallBack,397 dwData));398 399 return (FALSE);400 }401 402 403 /*****************************************************************************404 * Name : BOOL WIN32API SendMessageCallbackW405 * Purpose : The SendMessageCallback function sends the specified message to406 * a window or windows. The function calls the window procedure for407 * the specified window and returns immediately. After the window408 * procedure processes the message, the system calls the specified409 * callback function, passing the result of the message processing410 * and an application-defined value to the callback function.411 * Parameters: HWND hwnd handle of destination window412 * UINT uMsg message to send413 * WPARAM wParam first message parameter414 * LPARAM lParam second message parameter415 * SENDASYNCPROC lpResultCallBack function to receive message value416 * DWORD dwData value to pass to callback function417 * Variables :418 * Result : If the function succeeds, the return value is TRUE.419 * If the function fails, the return value is FALSE. To get extended420 * error information, call GetLastError.421 * Remark :422 * Status : UNTESTED STUB423 *424 * Author : Patrick Haller [Thu, 1998/02/26 11:55]425 *****************************************************************************/426 427 BOOL WIN32API SendMessageCallbackW(HWND hWnd,428 UINT uMsg,429 WPARAM wParam,430 LPARAM lParam,431 SENDASYNCPROC lpResultCallBack,432 DWORD dwData)433 {434 dprintf(("USER32:SendMessageCallBackW (%08xh,%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",435 hWnd,436 uMsg,437 wParam,438 lParam,439 lpResultCallBack,440 dwData));441 442 return (FALSE);443 }444 /*****************************************************************************445 * Name : long WIN32API BroadcastSystemMessage446 * Purpose : The BroadcastSystemMessage function sends a message to the given447 * recipients. The recipients can be applications, installable448 * drivers, Windows-based network drivers, system-level device449 * drivers, or any combination of these system components.450 * Parameters: DWORD dwFlags,451 LPDWORD lpdwRecipients,452 UINT uiMessage,453 WPARAM wParam,454 LPARAM lParam455 * Variables :456 * Result : If the function succeeds, the return value is a positive value.457 * If the function is unable to broadcast the message, the return value is -1.458 * If the dwFlags parameter is BSF_QUERY and at least one recipient returned FALSE to the corresponding message, the return value is zero.459 * Remark :460 * Status : UNTESTED STUB461 *462 * Author : Patrick Haller [Thu, 1998/02/26 11:55]463 *****************************************************************************/464 465 long WIN32API BroadcastSystemMessage(DWORD dwFlags,466 LPDWORD lpdwRecipients,467 UINT uiMessage,468 WPARAM wParam,469 LPARAM lParam)470 {471 dprintf(("USER32:BroadcastSystemMessage(%08xh,%08xh,%08xh,%08xh,%08x) not implemented.\n",472 dwFlags,473 lpdwRecipients,474 uiMessage,475 wParam,476 lParam));477 478 return (-1);479 217 } 480 218 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.