Changeset 2250 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Dec 29, 1999, 3:37:19 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r2246 r2250 1 /* $Id: win32wbase.cpp,v 1.12 3 1999-12-29 12:39:45sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.124 1999-12-29 14:37:17 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 923 923 //****************************************************************************** 924 924 //****************************************************************************** 925 ULONG Win32BaseWindow::DispatchMsg (MSG *msg)925 ULONG Win32BaseWindow::DispatchMsgA(MSG *msg) 926 926 { 927 927 return SendInternalMessageA(msg->message, msg->wParam, msg->lParam); 928 } 929 //****************************************************************************** 930 //****************************************************************************** 931 ULONG Win32BaseWindow::DispatchMsgW(MSG *msg) 932 { 933 return SendInternalMessageW(msg->message, msg->wParam, msg->lParam); 928 934 } 929 935 //****************************************************************************** … … 1818 1824 Win32BaseWindow *window = GetTopParent(); 1819 1825 if(window && !(window->getClass()->getStyle() & CS_NOCLOSE)) 1820 window->PostMessageA(WM_SYSCOMMAND, SC_CLOSE, 0);1826 PostMessageA(getWindowHandle(), WM_SYSCOMMAND, SC_CLOSE, 0); 1821 1827 } 1822 1828 … … 1977 1983 LRESULT Win32BaseWindow::SendMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam) 1978 1984 { 1979 POSTMSG_PACKET *packet;1980 1981 1985 //if the destination window is created by this process & thread, call window proc directly 1982 1986 if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) { … … 1984 1988 } 1985 1989 //otherwise use WinSendMsg to send it to the right process/thread 1986 packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 1987 packet->Msg = Msg; 1988 packet->wParam = wParam; 1989 packet->lParam = lParam; 1990 packet->fUnicode = FALSE; 1991 return OSLibSendMessage(getOS2WindowHandle(), WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet); 1990 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, FALSE); 1992 1991 } 1993 1992 //****************************************************************************** … … 1995 1994 LRESULT Win32BaseWindow::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam) 1996 1995 { 1997 POSTMSG_PACKET *packet;1998 1999 1996 //if the destination window is created by this process & thread, call window proc directly 2000 1997 if(dwProcessId == currentProcessId && dwThreadId == GetCurrentThreadId()) { … … 2002 1999 } 2003 2000 //otherwise use WinSendMsg to send it to the right process/thread 2004 packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET)); 2005 packet->Msg = Msg; 2006 packet->wParam = wParam; 2007 packet->lParam = lParam; 2008 packet->fUnicode = TRUE; 2009 return OSLibSendMessage(getOS2WindowHandle(), WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet); 2001 return OSLibSendMessage(getOS2WindowHandle(), Msg, wParam, lParam, TRUE); 2010 2002 } 2011 2003 //****************************************************************************** … … 2127 2119 //****************************************************************************** 2128 2120 //****************************************************************************** 2129 BOOL Win32BaseWindow::PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam)2130 {2131 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));2132 2133 packet->Msg = msg;2134 packet->wParam = wParam;2135 packet->lParam = lParam;2136 packet->fUnicode = FALSE;2137 return OSLibPostMessage(OS2Hwnd, WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet);2138 }2139 //******************************************************************************2140 //******************************************************************************2141 BOOL Win32BaseWindow::PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam)2142 {2143 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));2144 2145 packet->Msg = msg;2146 packet->wParam = wParam;2147 packet->lParam = lParam;2148 packet->fUnicode = TRUE;2149 return OSLibPostMessage(OS2Hwnd, WIN32APP_POSTMSG, WIN32PM_MAGIC, (DWORD)packet);2150 }2151 //******************************************************************************2152 //******************************************************************************2153 BOOL Win32BaseWindow::PostThreadMessageA(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam)2154 {2155 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));2156 2157 dprintf(("PostThreadMessageA %x %x %x %x", threadid, msg, wParam, lParam));2158 packet->Msg = msg;2159 packet->wParam = wParam;2160 packet->lParam = lParam;2161 packet->fUnicode = FALSE;2162 return OSLibPostThreadMessage(threadid, WIN32APP_POSTMSG, WIN32PM_MAGIC, (LPARAM)packet);2163 }2164 //******************************************************************************2165 //******************************************************************************2166 BOOL Win32BaseWindow::PostThreadMessageW(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam)2167 {2168 POSTMSG_PACKET *packet = (POSTMSG_PACKET *)_smalloc(sizeof(POSTMSG_PACKET));2169 2170 dprintf(("PostThreadMessageW %x %x %x %x", threadid, msg, wParam, lParam));2171 packet->Msg = msg;2172 packet->wParam = wParam;2173 packet->lParam = lParam;2174 packet->fUnicode = TRUE;2175 return OSLibPostThreadMessage(threadid, WIN32APP_POSTMSG, WIN32PM_MAGIC, (LPARAM)packet);2176 }2177 //******************************************************************************2178 //******************************************************************************2179 ULONG Win32BaseWindow::PostMessage(POSTMSG_PACKET *packet)2180 {2181 ULONG rc;2182 2183 if(packet == NULL)2184 return 0;2185 2186 if(packet->fUnicode) {2187 rc = SendInternalMessageW(packet->Msg, packet->wParam, packet->lParam);2188 }2189 else rc = SendInternalMessageA(packet->Msg, packet->wParam, packet->lParam);2190 2191 free(packet);2192 return rc;2193 }2194 2121 //****************************************************************************** 2195 2122 //TODO: Do this more efficiently … … 2211 2138 window->SendInternalMessageA(msg, wParam, lParam); 2212 2139 } 2213 else window->PostMessageA(msg, wParam, lParam);2140 else PostMessageA(window->getWindowHandle(), msg, wParam, lParam); 2214 2141 } 2215 2142 } … … 2224 2151 Win32BaseWindow *window; 2225 2152 HWND hwnd = WNDHANDLE_MAGIC_HIGHWORD; 2226 2227 2153 2228 2154 dprintf(("BroadCastMessageW %x %x %x", msg, wParam, lParam)); … … 2237 2163 window->SendInternalMessageW(msg, wParam, lParam); 2238 2164 } 2239 else window->PostMessageW(msg, wParam, lParam);2165 else PostMessageW(window->getWindowHandle(), msg, wParam, lParam); 2240 2166 } 2241 2167 }
Note:
See TracChangeset
for help on using the changeset viewer.