Changeset 729 for trunk/src/user32/new/win32wnd.cpp
- Timestamp:
- Aug 28, 1999, 9:33:04 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wnd.cpp
r728 r729 1 /* $Id: win32wnd.cpp,v 1.3 3 1999-08-28 17:24:45 dengertExp $ */1 /* $Id: win32wnd.cpp,v 1.34 1999-08-28 19:32:47 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 23 23 #include <assert.h> 24 24 #include <misc.h> 25 #include <handlemanager.h>26 25 #include <heapstring.h> 27 26 #include <win32wnd.h> … … 33 32 #include <oslibgdi.h> 34 33 #include <oslibres.h> 34 #include "oslibdos.h" 35 35 #include <winres.h> 36 36 #include "syscolor.h" 37 #include "win32wndhandle.h" 38 #include "heapshared.h" 37 39 38 40 #define HAS_DLGFRAME(style,exStyle) \ … … 86 88 Win32Hwnd = 0; 87 89 88 if(H MHandleAllocate(&Win32Hwnd, (ULONG)this) != 0)90 if(HwAllocateWindowHandle(&Win32Hwnd, (ULONG)this) == FALSE) 89 91 { 90 dprintf(("Win32Window::Init H MHandleAllocate failed!!"));92 dprintf(("Win32Window::Init HwAllocateWindowHandle failed!!")); 91 93 DebugInt3(); 92 94 } 93 Win32Hwnd &= 0xFFFF;94 Win32Hwnd |= 0x68000000;95 95 96 96 posx = posy = 0; … … 124 124 125 125 if(Win32Hwnd) 126 HMHandleFree(Win32Hwnd & 0xFFFF); 126 HwFreeWindowHandle(Win32Hwnd); 127 127 128 if(userWindowLong) 128 129 free(userWindowLong); … … 269 270 if(owner == NULL) 270 271 { 271 dprintf(("H MHandleTranslateToOS2couldn't find owner window %x!!!", cs->hwndParent));272 dprintf(("HwGetWindowHandleData couldn't find owner window %x!!!", cs->hwndParent)); 272 273 return FALSE; 273 274 } … … 283 284 if(owner == NULL) 284 285 { 285 dprintf(("H MHandleTranslateToOS2couldn't find owner window %x!!!", cs->hwndParent));286 dprintf(("HwGetWindowHandleData couldn't find owner window %x!!!", cs->hwndParent)); 286 287 return FALSE; 287 288 } … … 403 404 return FALSE; 404 405 } 406 //SvL: Need to store the shared memory base, or else other apps can map it into their memory space 407 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_SHAREDMEM, HeapGetSharedMemBase()) == FALSE) { 408 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd)); 409 return FALSE; 410 } 405 411 #if 0 406 412 if(OS2Hwnd != OS2HwndFrame) { … … 410 416 } 411 417 if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) { 418 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame)); 419 return FALSE; 420 } 421 //SvL: Need to store the shared memory base, or else other apps can map it into their memory space 422 if(OSLibWinSetWindowULong(OS2HwndFrame, OFFSET_WIN32PM_SHAREDMEM, HeapGetSharedMemBase()) == FALSE) { 412 423 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2HwndFrame)); 413 424 return FALSE; … … 1334 1345 BOOL Win32Window::PostMessageA(ULONG msg, WPARAM wParam, LPARAM lParam) 1335 1346 { 1336 POSTMSG_PACKET *postmsg; 1337 1338 postmsg = (POSTMSG_PACKET *)malloc(sizeof(POSTMSG_PACKET)); 1339 if(postmsg == NULL) { 1340 dprintf(("Win32Window::PostMessageA: malloc returned NULL!!")); 1341 return 0; 1342 } 1343 postmsg->Msg = msg; 1344 postmsg->wParam = wParam; 1345 postmsg->lParam = lParam; 1346 return OSLibPostMessage(OS2Hwnd, WM_WIN32_POSTMESSAGEA, (ULONG)postmsg, 0); 1347 return OSLibPostMessage(OS2Hwnd, WIN32APP_USERMSGBASE+msg, wParam, lParam); 1347 1348 } 1348 1349 //****************************************************************************** … … 1350 1351 BOOL Win32Window::PostMessageW(ULONG msg, WPARAM wParam, LPARAM lParam) 1351 1352 { 1352 POSTMSG_PACKET *postmsg; 1353 1354 postmsg = (POSTMSG_PACKET *)malloc(sizeof(POSTMSG_PACKET)); 1355 if(postmsg == NULL) { 1356 dprintf(("Win32Window::PostMessageW: malloc returned NULL!!")); 1357 return 0; 1358 } 1359 postmsg->Msg = msg; 1360 postmsg->wParam = wParam; 1361 postmsg->lParam = lParam; 1362 return OSLibPostMessage(OS2Hwnd, WM_WIN32_POSTMESSAGEW, (ULONG)postmsg, 0); 1353 return OSLibPostMessage(OS2Hwnd, WIN32APP_USERMSGBASE+msg, wParam, lParam); 1363 1354 } 1364 1355 //****************************************************************************** … … 1743 1734 while(hwnd) 1744 1735 { 1745 HWND hwndClient;1746 1747 1736 wnd = GetWindowFromOS2Handle(hwnd); 1748 1737 if(wnd == NULL) { 1749 hwnd Client= OSLibWinQueryClientWindow(hwnd);1750 if(hwnd Client) wnd = GetWindowFromOS2Handle(hwndClient);1738 hwnd = OSLibWinQueryClientWindow(hwnd); 1739 if(hwnd) wnd = GetWindowFromOS2Handle(hwnd); 1751 1740 } 1752 1741 1753 if(wnd && wnd->getWindowClass()->hasClassName(lpszClass, fUnicode) && 1754 (!lpszWindow || wnd->hasWindowName(lpszWindow, fUnicode))) 1755 { 1756 OSLibWinEndEnumWindows(henum); 1757 dprintf(("FindWindowEx: Found window %x", wnd->getWindowHandle())); 1758 return wnd->getWindowHandle(); 1742 if(wnd) { 1743 LPVOID sharedmembase = (LPVOID)OSLibWinGetWindowULong(hwnd, OFFSET_WIN32PM_SHAREDMEM); 1744 1745 if(OSLibDosGetSharedMem(sharedmembase, MAX_HEAPSIZE, OSLIB_PAG_READ) != 0) { 1746 dprintf(("OSLibDosGetSharedMem returned error for %x", wnd)); 1747 break; 1748 } 1749 if(wnd->getWindowClass()->hasClassName(lpszClass, fUnicode) && 1750 (!lpszWindow || wnd->hasWindowName(lpszWindow, fUnicode))) 1751 { 1752 OSLibWinEndEnumWindows(henum); 1753 dprintf(("FindWindowEx: Found window %x", wnd->getWindowHandle())); 1754 return wnd->getWindowHandle(); 1755 } 1759 1756 } 1760 1757 hwnd = OSLibWinGetNextWindow(henum); … … 2033 2030 Win32Window *window; 2034 2031 2035 if(HIWORD(hwnd) != 0x6800) { 2036 return NULL; 2037 } 2038 2039 if(HMHandleTranslateToOS2(LOWORD(hwnd), (PULONG)&window) == NO_ERROR) { 2032 if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) { 2040 2033 return window; 2041 2034 }
Note:
See TracChangeset
for help on using the changeset viewer.