Changeset 4825 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Dec 17, 2000, 4:04:14 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r4658 r4825 1 /* $Id: win32wbase.cpp,v 1.22 4 2000-11-21 11:36:09sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.225 2000-12-17 15:04:11 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 194 194 } 195 195 196 /* Decrement class window counter */ 197 if(windowClass) { 198 windowClass->DecreaseWindowCount(); 199 } 200 196 201 if(isOwnDC()) 197 202 releaseOwnDC(ownDC); … … 290 295 } 291 296 292 /* Find the window class */293 windowClass = Win32WndClass::FindClass(cs->hInstance, (LPSTR)classAtom);294 if (!windowClass)295 {297 /* Find the window class */ 298 windowClass = Win32WndClass::FindClass(cs->hInstance, (LPSTR)classAtom); 299 if (!windowClass) 300 { 296 301 GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) ); 297 302 dprintf(("Bad class '%s'\n", buffer )); 298 303 SetLastError(ERROR_INVALID_PARAMETER); 299 304 return 0; 300 } 305 } 306 /* Increment class window counter */ 307 windowClass->IncreaseWindowCount(); 308 301 309 #ifdef DEBUG 302 if(HIWORD(cs->lpszClass))303 {310 if(HIWORD(cs->lpszClass)) 311 { 304 312 char *astring; 305 313 … … 309 317 dprintf(("Window class %s", astring)); 310 318 if(isUnicode) FreeAsciiString(astring); 311 }312 elsedprintf(("Window class %x", cs->lpszClass));319 } 320 else dprintf(("Window class %x", cs->lpszClass)); 313 321 #endif 314 322 315 /* Fix the lpszClass field: from existing programs, it seems ok to call a CreateWindowXXX316 * with an atom as the class name, put some programs expect to have a *REAL* string in317 * lpszClass when the CREATESTRUCT is sent with WM_CREATE318 */319 if (!HIWORD(cs->lpszClass) ) {323 /* Fix the lpszClass field: from existing programs, it seems ok to call a CreateWindowXXX 324 * with an atom as the class name, put some programs expect to have a *REAL* string in 325 * lpszClass when the CREATESTRUCT is sent with WM_CREATE 326 */ 327 if (!HIWORD(cs->lpszClass) ) { 320 328 if (isUnicode) { 321 329 GlobalGetAtomNameW( classAtom, (LPWSTR)buffer, sizeof(buffer) ); … … 325 333 } 326 334 cs->lpszClass = buffer; 327 }328 329 /* Fix the coordinates */330 fXDefault = FALSE;331 fCXDefault = FALSE;332 if ((cs->x == CW_USEDEFAULT) || (cs->x == CW_USEDEFAULT16))333 {335 } 336 337 /* Fix the coordinates */ 338 fXDefault = FALSE; 339 fCXDefault = FALSE; 340 if ((cs->x == CW_USEDEFAULT) || (cs->x == CW_USEDEFAULT16)) 341 { 334 342 /* Never believe Microsoft's documentation... CreateWindowEx doc says 335 343 * that if an overlapped window is created with WS_VISIBLE style bit … … 354 362 cs->y = 0; 355 363 fXDefault = TRUE; 356 }357 if ((cs->cx == CW_USEDEFAULT) || (cs->cx == CW_USEDEFAULT16))358 {364 } 365 if ((cs->cx == CW_USEDEFAULT) || (cs->cx == CW_USEDEFAULT16)) 366 { 359 367 cs->cx = 600; /* FIXME */ 360 368 cs->cy = 400; 361 369 fCXDefault = TRUE; 362 }363 if (cs->style & (WS_POPUP | WS_CHILD))364 {365 fXDefault = FALSE;366 if (fCXDefault)367 {368 fCXDefault = FALSE;369 cs->cx = cs->cy = 0;370 }371 }372 if (fXDefault && !fCXDefault) fXDefault = FALSE; //CB: only x positioning doesn't work (calc.exe,cdrlabel.exe)373 374 if (cs->x < 0) cs->x = 0;375 if (cs->y < 0) cs->y = 0;376 377 //Allocate window words378 nrUserWindowLong = windowClass->getExtraWndWords();379 if(nrUserWindowLong) {370 } 371 if (cs->style & (WS_POPUP | WS_CHILD)) 372 { 373 fXDefault = FALSE; 374 if (fCXDefault) 375 { 376 fCXDefault = FALSE; 377 cs->cx = cs->cy = 0; 378 } 379 } 380 if (fXDefault && !fCXDefault) fXDefault = FALSE; //CB: only x positioning doesn't work (calc.exe,cdrlabel.exe) 381 382 if (cs->x < 0) cs->x = 0; 383 if (cs->y < 0) cs->y = 0; 384 385 //Allocate window words 386 nrUserWindowLong = windowClass->getExtraWndWords(); 387 if(nrUserWindowLong) { 380 388 userWindowLong = (ULONG *)_smalloc(nrUserWindowLong); 381 389 memset(userWindowLong, 0, nrUserWindowLong); 382 }383 384 if ((cs->style & WS_CHILD) && cs->hwndParent)385 {390 } 391 392 if ((cs->style & WS_CHILD) && cs->hwndParent) 393 { 386 394 SetParent(cs->hwndParent); 387 395 // owner = GetWindowFromHandle(cs->hwndParent); 388 owner = 0;396 owner = 0; 389 397 /* if(owner == NULL) 390 398 { … … 395 403 //SvL: Shell positioning shouldn't be done for child windows! (breaks Notes) 396 404 fXDefault = fCXDefault = FALSE; 397 }398 else399 {405 } 406 else 407 { 400 408 SetParent(0); 401 409 if (!cs->hwndParent || (cs->hwndParent == windowDesktop->getWindowHandle())) { … … 412 420 } 413 421 } 414 } 415 416 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), WINPROC_GetProcType(windowClass->getWindowProc()), WIN_PROC_WINDOW); 417 hInstance = cs->hInstance; 418 dwStyle = cs->style & ~WS_VISIBLE; 419 dwExStyle = cs->dwExStyle; 420 421 hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP; 422 423 /* Increment class window counter */ 424 windowClass->IncreaseWindowCount(); 425 426 if (HOOK_IsHooked( WH_CBT )) 427 { 422 } 423 424 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), WINPROC_GetProcType(windowClass->getWindowProc()), WIN_PROC_WINDOW); 425 hInstance = cs->hInstance; 426 dwStyle = cs->style & ~WS_VISIBLE; 427 dwExStyle = cs->dwExStyle; 428 429 hwndLinkAfter = ((cs->style & (WS_CHILD|WS_MAXIMIZE)) == WS_CHILD) ? HWND_BOTTOM : HWND_TOP; 430 431 /* Correct the window style */ 432 if (!(cs->style & WS_CHILD)) 433 { 434 dwStyle |= WS_CLIPSIBLINGS; 435 if (!(cs->style & WS_POPUP)) 436 { 437 dwStyle |= WS_CAPTION; 438 flags |= WIN_NEED_SIZE; 439 } 440 } 441 if (cs->dwExStyle & WS_EX_DLGMODALFRAME) dwStyle &= ~WS_THICKFRAME; 442 443 //copy pointer of CREATESTRUCT for usage in MsgCreate method 444 tmpcs = cs; 445 446 //Store our window object pointer in thread local memory, so PMWINDOW.CPP can retrieve it 447 TEB *teb = GetThreadTEB(); 448 if(teb == NULL) { 449 dprintf(("Window creation failed - teb == NULL")); //this is VERY bad 450 ExitProcess(666); 451 return FALSE; 452 } 453 454 teb->o.odin.newWindow = (ULONG)this; 455 456 DWORD dwOSWinStyle; 457 458 OSLibWinConvertStyle(dwStyle,dwExStyle,&dwOSWinStyle); 459 460 OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 461 dwOSWinStyle,(char *)windowNameA, 462 (owner) ? owner->getOS2WindowHandle() : ((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP), 463 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 464 0, fTaskList,fXDefault | fCXDefault,windowClass->getStyle()); 465 if(OS2Hwnd == 0) { 466 dprintf(("Window creation failed!! OS LastError %0x", OSLibWinGetLastError())); 467 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 468 return FALSE; 469 } 470 OSLibWinSetVisibleRegionNotify(OS2Hwnd, TRUE); 471 SetLastError(0); 472 return TRUE; 473 } 474 //****************************************************************************** 475 //****************************************************************************** 476 BOOL Win32BaseWindow::MsgCreate(HWND hwndOS2) 477 { 478 CREATESTRUCTA *cs = tmpcs; //pointer to CREATESTRUCT used in CreateWindowExA method 479 POINT maxSize, maxPos, minTrack, maxTrack; 480 481 OS2Hwnd = hwndOS2; 482 483 fNoSizeMsg = TRUE; 484 485 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) { 486 dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd)); 487 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 488 return FALSE; 489 } 490 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) { 491 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd)); 492 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 493 return FALSE; 494 } 495 496 if (HOOK_IsHooked( WH_CBT )) 497 { 428 498 CBT_CREATEWNDA cbtc; 429 499 LRESULT ret; … … 431 501 cbtc.lpcs = cs; 432 502 cbtc.hwndInsertAfter = hwndLinkAfter; 433 ret = HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, getWindowHandle(), (LPARAM)&cbtc); 503 ret = (isUnicode) ? HOOK_CallHooksW(WH_CBT, HCBT_CREATEWND, getWindowHandle(), (LPARAM)&cbtc) 504 : HOOK_CallHooksA(WH_CBT, HCBT_CREATEWND, getWindowHandle(), (LPARAM)&cbtc); 434 505 if(ret) 435 506 { … … 438 509 return FALSE; 439 510 } 440 } 441 442 /* Correct the window style */ 443 if (!(cs->style & WS_CHILD)) 444 { 445 dwStyle |= WS_CLIPSIBLINGS; 446 if (!(cs->style & WS_POPUP)) 447 { 448 dwStyle |= WS_CAPTION; 449 flags |= WIN_NEED_SIZE; 450 } 451 } 452 if (cs->dwExStyle & WS_EX_DLGMODALFRAME) dwStyle &= ~WS_THICKFRAME; 453 454 if (cs->style & WS_HSCROLL) 455 { 511 //todo: if hook changes parent, we need to do so too!!!!!!!!!! 512 } 513 514 if (cs->style & WS_HSCROLL) 515 { 456 516 horzScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 457 517 horzScrollInfo->MinVal = horzScrollInfo->CurVal = horzScrollInfo->Page = 0; 458 518 horzScrollInfo->MaxVal = 100; 459 519 horzScrollInfo->flags = ESB_ENABLE_BOTH; 460 }461 462 if (cs->style & WS_VSCROLL)463 {520 } 521 522 if (cs->style & WS_VSCROLL) 523 { 464 524 vertScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 465 525 vertScrollInfo->MinVal = vertScrollInfo->CurVal = vertScrollInfo->Page = 0; 466 526 vertScrollInfo->MaxVal = 100; 467 527 vertScrollInfo->flags = ESB_ENABLE_BOTH; 468 } 469 470 if(HIWORD(cs->lpszName)) 471 { 472 if (!isUnicode) 473 { 474 wndNameLength = strlen(cs->lpszName); 475 windowNameA = (LPSTR)_smalloc(wndNameLength+1); 476 strcpy(windowNameA,cs->lpszName); 477 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 478 lstrcpyAtoW(windowNameW,windowNameA); 479 windowNameA[wndNameLength] = 0; 480 windowNameW[wndNameLength] = 0; 481 } 482 else 483 { 484 wndNameLength = lstrlenW((LPWSTR)cs->lpszName); 485 windowNameA = (LPSTR)_smalloc(wndNameLength+1); 486 lstrcpyWtoA(windowNameA,(LPWSTR)cs->lpszName); 487 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 488 lstrcpyW(windowNameW,(LPWSTR)cs->lpszName); 489 windowNameA[wndNameLength] = 0; 490 windowNameW[wndNameLength] = 0; 491 } 492 } 493 494 //copy pointer of CREATESTRUCT for usage in MsgCreate method 495 tmpcs = cs; 496 497 //Store our window object pointer in thread local memory, so PMWINDOW.CPP can retrieve it 498 TEB *teb = GetThreadTEB(); 499 500 if(teb == NULL) { 501 dprintf(("Window creation failed - teb == NULL")); //this is VERY bad 502 ExitProcess(666); 503 return FALSE; 504 } 505 506 teb->o.odin.newWindow = (ULONG)this; 507 508 DWORD dwOSWinStyle; 509 510 OSLibWinConvertStyle(dwStyle,dwExStyle,&dwOSWinStyle); 511 512 OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 513 dwOSWinStyle,(char *)windowNameA, 514 (owner) ? owner->getOS2WindowHandle() : ((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP), 515 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 516 0, fTaskList,fXDefault | fCXDefault,windowClass->getStyle()); 517 if(OS2Hwnd == 0) { 518 dprintf(("Window creation failed!! OS LastError %0x", OSLibWinGetLastError())); 519 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 520 return FALSE; 521 } 522 OSLibWinSetVisibleRegionNotify(OS2Hwnd, TRUE); 523 SetLastError(0); 524 return TRUE; 525 } 526 //****************************************************************************** 527 //****************************************************************************** 528 BOOL Win32BaseWindow::MsgCreate(HWND hwndOS2) 529 { 530 CREATESTRUCTA *cs = tmpcs; //pointer to CREATESTRUCT used in CreateWindowExA method 531 POINT maxSize, maxPos, minTrack, maxTrack; 532 533 OS2Hwnd = hwndOS2; 534 535 fNoSizeMsg = TRUE; 536 537 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) { 538 dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd)); 539 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 540 return FALSE; 541 } 542 if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) { 543 dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd)); 544 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 545 return FALSE; 546 } 528 } 529 530 if(HIWORD(cs->lpszName)) 531 { 532 if (!isUnicode) 533 { 534 wndNameLength = strlen(cs->lpszName); 535 windowNameA = (LPSTR)_smalloc(wndNameLength+1); 536 strcpy(windowNameA,cs->lpszName); 537 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 538 lstrcpyAtoW(windowNameW,windowNameA); 539 windowNameA[wndNameLength] = 0; 540 windowNameW[wndNameLength] = 0; 541 } 542 else 543 { 544 wndNameLength = lstrlenW((LPWSTR)cs->lpszName); 545 windowNameA = (LPSTR)_smalloc(wndNameLength+1); 546 lstrcpyWtoA(windowNameA,(LPWSTR)cs->lpszName); 547 windowNameW = (LPWSTR)_smalloc((wndNameLength+1)*sizeof(WCHAR)); 548 lstrcpyW(windowNameW,(LPWSTR)cs->lpszName); 549 windowNameA[wndNameLength] = 0; 550 windowNameW[wndNameLength] = 0; 551 } 552 } 553 547 554 548 555 //SvL: This completely messes up MS Word 97 (no button bar, no menu) … … 573 580 #endif 574 581 575 fakeWinBase.hwndThis = OS2Hwnd; 576 fakeWinBase.pWindowClass = windowClass; 577 578 //Set icon from window or class 579 if (hIcon) 580 OSLibWinSetIcon(OS2Hwnd,hIcon); 581 else if (windowClass->getIcon()) 582 OSLibWinSetIcon(OS2Hwnd,windowClass->getIcon()); 583 584 /* Get class or window DC if needed */ 585 if(windowClass->getStyle() & CS_OWNDC) { 582 fakeWinBase.hwndThis = OS2Hwnd; 583 fakeWinBase.pWindowClass = windowClass; 584 585 //Set icon from window or class 586 if (hIcon) 587 OSLibWinSetIcon(OS2Hwnd,hIcon); 588 else 589 if (windowClass->getIcon()) 590 OSLibWinSetIcon(OS2Hwnd,windowClass->getIcon()); 591 592 /* Get class or window DC if needed */ 593 if(windowClass->getStyle() & CS_OWNDC) { 586 594 dprintf(("Class with CS_OWNDC style")); 587 595 ownDC = GetDCEx(getWindowHandle(), NULL, DCX_USESTYLE); 588 }589 else590 if (windowClass->getStyle() & CS_PARENTDC) {596 } 597 else 598 if (windowClass->getStyle() & CS_PARENTDC) { 591 599 fParentDC = TRUE; 592 600 ownDC = 0; 593 }594 else595 if (windowClass->getStyle() & CS_CLASSDC) {601 } 602 else 603 if (windowClass->getStyle() & CS_CLASSDC) { 596 604 dprintf(("WARNING: Class with CS_CLASSDC style!")); 597 605 ownDC = 0; 598 }599 /* Set the window menu */600 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION )601 {606 } 607 /* Set the window menu */ 608 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION ) 609 { 602 610 if (cs->hMenu) { 603 611 ::SetMenu(getWindowHandle(), cs->hMenu); … … 612 620 } 613 621 } 614 }615 else616 {622 } 623 else 624 { 617 625 setWindowId((DWORD)cs->hMenu); 618 }619 hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0;620 621 /* Send the WM_GETMINMAXINFO message and fix the size if needed */622 if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD)))623 {624 GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack);626 } 627 hSysMenu = (dwStyle & WS_SYSMENU) ? MENU_GetSysMenu(Win32Hwnd,0):0; 628 629 /* Send the WM_GETMINMAXINFO message and fix the size if needed */ 630 if ((cs->style & WS_THICKFRAME) || !(cs->style & (WS_POPUP | WS_CHILD))) 631 { 632 GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack); 625 633 if (maxSize.x < cs->cx) cs->cx = maxSize.x; 626 634 if (maxSize.y < cs->cy) cs->cy = maxSize.y; 627 635 if (cs->cx < minTrack.x) cs->cx = minTrack.x; 628 636 if (cs->cy < minTrack.y) cs->cy = minTrack.y; 629 }630 631 if(cs->style & WS_CHILD)632 {637 } 638 639 if(cs->style & WS_CHILD) 640 { 633 641 if(cs->cx < 0) cs->cx = 0; 634 642 if(cs->cy < 0) cs->cy = 0; 635 }636 else637 {643 } 644 else 645 { 638 646 if (cs->cx <= 0) cs->cx = 1; 639 647 if (cs->cy <= 0) cs->cy = 1; 640 }641 642 //set client & window rectangles from CreateWindowEx CREATESTRUCT643 rectWindow.left = cs->x;644 rectWindow.right = cs->x+cs->cx;645 rectWindow.top = cs->y;646 rectWindow.bottom = cs->y+cs->cy;647 rectClient = rectWindow;648 OffsetRect(&rectClient, -rectClient.left, -rectClient.top);649 650 /* Send the WM_CREATE message651 * Perhaps we shouldn't allow width/height changes as well.652 * See p327 in "Internals".653 */654 maxPos.x = rectWindow.left; maxPos.y = rectWindow.top;655 656 //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE657 fCreated = TRUE;658 659 if(fTaskList) {660 hTaskList = OSLibWinAddToTaskList(OS2Hwnd, windowNameA, (cs->style & WS_VISIBLE) ? 1 : 0);661 }662 663 //cs is ascii version of create structure. so use SendInternalMessageA664 if(SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))665 {648 } 649 650 //set client & window rectangles from CreateWindowEx CREATESTRUCT 651 rectWindow.left = cs->x; 652 rectWindow.right = cs->x+cs->cx; 653 rectWindow.top = cs->y; 654 rectWindow.bottom = cs->y+cs->cy; 655 rectClient = rectWindow; 656 OffsetRect(&rectClient, -rectClient.left, -rectClient.top); 657 658 /* Send the WM_CREATE message 659 * Perhaps we shouldn't allow width/height changes as well. 660 * See p327 in "Internals". 661 */ 662 maxPos.x = rectWindow.left; maxPos.y = rectWindow.top; 663 664 //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE 665 fCreated = TRUE; 666 667 if(fTaskList) { 668 hTaskList = OSLibWinAddToTaskList(OS2Hwnd, windowNameA, (cs->style & WS_VISIBLE) ? 1 : 0); 669 } 670 671 //cs is ascii version of create structure. so use SendInternalMessageA 672 if(SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 673 { 666 674 RECT tmpRect; 667 675 … … 722 730 return TRUE; 723 731 } 724 }725 dprintf(("Window creation FAILED (NCCREATE cancelled creation)"));726 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error732 } 733 dprintf(("Window creation FAILED (NCCREATE cancelled creation)")); 734 SetLastError(ERROR_OUTOFMEMORY); //TODO: Better error 727 735 end: 728 return FALSE;736 return FALSE; 729 737 } 730 738 //****************************************************************************** … … 2367 2375 { 2368 2376 MsgFormatFrame(NULL); 2369 if(RECT_WIDTH(rectClient) != RECT_WIDTH(*oldClientRect) || 2370 RECT_HEIGHT(rectClient) != RECT_HEIGHT(*oldClientRect)) 2377 if(RECT_WIDTH(rectClient) != RECT_WIDTH(*oldClientRect) || 2378 RECT_HEIGHT(rectClient) != RECT_HEIGHT(*oldClientRect)) 2371 2379 { 2372 2380 wpos->flags &= ~SWP_NOSIZE; … … 2824 2832 { 2825 2833 case GW_HWNDFIRST: 2826 if(getParent()) { 2827 window = (Win32BaseWindow *)getParent(); 2828 hwndRelated = OSLibWinQueryWindow(window->getOS2WindowHandle(), QWOS_TOP); 2829 window = GetWindowFromOS2Handle(hwndRelated); 2830 if(window) { 2834 if(getParent()) 2835 { 2836 window = (Win32BaseWindow *)getParent(); 2837 hwndRelated = OSLibWinQueryWindow(window->getOS2WindowHandle(), QWOS_TOP); 2838 window = GetWindowFromOS2Handle(hwndRelated); 2839 if(window) { 2831 2840 hwndRelated = window->getWindowHandle(); 2832 2833 2834 } 2835 else hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop2841 } 2842 else hwndRelated = 0; 2843 } 2844 else hwndRelated = 0; //TODO: not correct; should get first child in z-order of desktop 2836 2845 break; 2837 2846 2838 2847 case GW_HWNDLAST: 2839 2848 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_BOTTOM); 2840 window = GetWindowFromOS2Handle(hwndRelated);2841 if(window) {2849 window = GetWindowFromOS2Handle(hwndRelated); 2850 if(window) { 2842 2851 hwndRelated = window->getWindowHandle(); 2843 2852 } 2844 else hwndRelated = 0;2853 else hwndRelated = 0; 2845 2854 break; 2846 2855 2847 2856 case GW_HWNDNEXT: 2848 2857 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_NEXT); 2849 window = GetWindowFromOS2Handle(hwndRelated);2850 if(window) {2858 window = GetWindowFromOS2Handle(hwndRelated); 2859 if(window) { 2851 2860 hwndRelated = window->getWindowHandle(); 2852 2861 } 2853 else hwndRelated = 0;2862 else hwndRelated = 0; 2854 2863 break; 2855 2864 2856 2865 case GW_HWNDPREV: 2857 2866 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_PREV); 2858 window = GetWindowFromOS2Handle(hwndRelated);2859 if(window) {2867 window = GetWindowFromOS2Handle(hwndRelated); 2868 if(window) { 2860 2869 hwndRelated = window->getWindowHandle(); 2861 2870 } 2862 else hwndRelated = 0;2871 else hwndRelated = 0; 2863 2872 break; 2864 2873 … … 2871 2880 case GW_CHILD: 2872 2881 hwndRelated = OSLibWinQueryWindow(getOS2WindowHandle(), QWOS_TOP); 2873 window = GetWindowFromOS2Handle(hwndRelated);2874 if(window) {2882 window = GetWindowFromOS2Handle(hwndRelated); 2883 if(window) { 2875 2884 hwndRelated = window->getWindowHandle(); 2876 2885 } 2877 else hwndRelated = 0;2886 else hwndRelated = 0; 2878 2887 break; 2879 2888 } … … 2983 2992 BOOL rc; 2984 2993 2994 dprintf(("Win32BaseWindow::EnableWindow %x %d", getWindowHandle(), fEnable)); 2985 2995 //return true if previous state was disabled, else false (sdk docs) 2986 2996 rc = (getStyle() & WS_DISABLED) != 0;
Note:
See TracChangeset
for help on using the changeset viewer.