Changeset 1839 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Nov 25, 1999, 8:22:04 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r1837 r1839 1 /* $Id: win32wbase.cpp,v 1.9 4 1999-11-24 20:28:20sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.95 1999-11-25 19:22:02 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 634 634 else 635 635 { 636 dprintf(("Set window ID to %x", cs->hMenu));637 636 setWindowId((DWORD)cs->hMenu); 638 637 } … … 1544 1543 1545 1544 case WM_SETREDRAW: 1545 { 1546 DWORD oldStyle = getStyle(); 1547 1546 1548 if(wParam) 1547 SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) | WS_VISIBLE); 1548 else SetWindowLongA (GWL_STYLE, GetWindowLongA (GWL_STYLE) & ~WS_VISIBLE); 1549 setStyle(getStyle() | WS_VISIBLE); 1550 else setStyle(getStyle() & ~WS_VISIBLE); 1551 1552 updateWindowStyle(getExStyle(), oldStyle); 1549 1553 1550 1554 return 0; //TODO 1551 1555 } 1552 1556 case WM_NCCREATE: 1553 1557 return(TRUE); … … 2068 2072 } 2069 2073 //****************************************************************************** 2070 // TODO: Probably not complete compatible with win32 implementation2071 //****************************************************************************** 2072 LRESULT Win32BaseWindow:: BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam)2074 //Send message to window of another process 2075 //****************************************************************************** 2076 LRESULT Win32BaseWindow::SendMessageToProcess(UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode) 2073 2077 { 2074 2078 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 2075 2079 2076 dprintf(("BroadCastMessageA %x %x %x", msg, wParam, lParam)); 2077 return 0; 2078 2080 dprintf(("SendMessageToProcess %x %x %x %x", getOS2WindowHandle(), msg, wParam, lParam)); 2079 2081 packet->Msg = msg; 2080 2082 packet->wParam = wParam; 2081 2083 packet->lParam = lParam; 2082 packet->fUnicode = FALSE; 2083 2084 return OSLibWinBroadcastMsg(WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet, type == BROADCAST_SEND); 2085 } 2086 //****************************************************************************** 2087 //TODO: Probably not complete compatible with win32 implementation 2084 packet->fUnicode = fUnicode; 2085 return OSLibSendMessage(getOS2WindowHandle(), WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet); 2086 } 2087 //****************************************************************************** 2088 //TODO: Do this more efficiently 2089 //****************************************************************************** 2090 LRESULT Win32BaseWindow::BroadcastMessageA(int type, UINT msg, WPARAM wParam, LPARAM lParam) 2091 { 2092 Win32BaseWindow *window; 2093 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD; 2094 DWORD processid, myprocessid; 2095 2096 dprintf(("BroadCastMessageA %x %x %x", msg, wParam, lParam, GetFS())); 2097 myprocessid = GetCurrentProcessId(); 2098 2099 for(int i=0;i<MAX_WINDOW_HANDLES;i++) { 2100 window = GetWindowFromHandle(hwnd++); 2101 if(window) { 2102 if (window->getStyle() & WS_POPUP || (window->getStyle() & WS_CAPTION) == WS_CAPTION) 2103 { 2104 2105 if(type == BROADCAST_SEND) { 2106 GetWindowThreadProcessId(hwnd, &processid); 2107 if(processid == myprocessid) { 2108 window->SendMessageA(msg, wParam, lParam); 2109 } 2110 else { 2111 window->SendMessageToProcess(msg, wParam, lParam, FALSE); 2112 } 2113 } 2114 else window->PostMessageA(msg, wParam, lParam); 2115 } 2116 } 2117 } 2118 return 0; 2119 } 2120 //****************************************************************************** 2121 //TODO: Do this more efficiently 2088 2122 //****************************************************************************** 2089 2123 LRESULT Win32BaseWindow::BroadcastMessageW(int type, UINT msg, WPARAM wParam, LPARAM lParam) 2090 2124 { 2091 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 2125 Win32BaseWindow *window; 2126 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD; 2127 DWORD processid, myprocessid; 2128 2092 2129 2093 2130 dprintf(("BroadCastMessageW %x %x %x", msg, wParam, lParam)); 2131 myprocessid = GetCurrentProcessId(); 2132 2133 for(int i=0;i<MAX_WINDOW_HANDLES;i++) { 2134 window = GetWindowFromHandle(hwnd++); 2135 if(window) { 2136 if (window->getStyle() & WS_POPUP || (window->getStyle() & WS_CAPTION) == WS_CAPTION) 2137 { 2138 2139 if(type == BROADCAST_SEND) { 2140 GetWindowThreadProcessId(hwnd, &processid); 2141 if(processid == myprocessid) { 2142 window->SendMessageW(msg, wParam, lParam); 2143 } 2144 else { 2145 window->SendMessageToProcess(msg, wParam, lParam, TRUE); 2146 } 2147 } 2148 else window->PostMessageW(msg, wParam, lParam); 2149 } 2150 } 2151 } 2094 2152 return 0; 2095 2096 packet->Msg = msg;2097 packet->wParam = wParam;2098 packet->lParam = lParam;2099 packet->fUnicode = TRUE;2100 2101 return OSLibWinBroadcastMsg(WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet, type == BROADCAST_SEND);2102 2153 } 2103 2154 //****************************************************************************** … … 2403 2454 return oldhwnd; 2404 2455 } 2405 SetLastError(ERROR_INVALID_PARAMETER); 2406 return 0; 2456 else { 2457 setParent(windowDesktop); 2458 getParent()->AddChild(this); 2459 OSLibWinSetParent(getOS2FrameWindowHandle(), OSLIB_HWND_DESKTOP); 2460 return oldhwnd; 2461 } 2407 2462 } 2408 2463 //****************************************************************************** … … 2814 2869 SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss); 2815 2870 setExStyle(ss.styleNew); 2816 updateWindowStyle(ss.styleOld, dwStyle);2871 updateWindowStyle(ss.styleOld,getStyle()); 2817 2872 SendMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss); 2818 2873 return ss.styleOld; … … 2825 2880 return value; 2826 2881 2827 ss.styleOld = dwStyle; 2828 ss.styleNew = value; 2829 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), dwStyle, value)); 2882 value &= ~(WS_VISIBLE | WS_CHILD); /* Some bits can't be changed this way (WINE) */ 2883 ss.styleOld = getStyle(); 2884 ss.styleNew = value | (ss.styleOld & (WS_VISIBLE | WS_CHILD)); 2885 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), getStyle(), value)); 2830 2886 SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); 2831 2887 setStyle(ss.styleNew); 2832 2888 updateWindowStyle(dwExStyle,ss.styleOld); 2833 2889 SendMessageA(WM_STYLECHANGED,GWL_STYLE,(LPARAM)&ss); 2890 #ifdef DEBUG 2891 PrintWindowStyle(ss.styleNew, 0); 2892 #endif 2834 2893 return ss.styleOld; 2835 2894 } … … 2937 2996 { 2938 2997 windowId = id; 2998 dprintf(("Set window ID to %x", id)); 2939 2999 OSLibSetWindowID(OS2HwndFrame, id); 2940 3000 }
Note:
See TracChangeset
for help on using the changeset viewer.