- Timestamp:
- Sep 5, 2000, 9:20:38 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/defwndproc.cpp
r2804 r4194 1 /* $Id: defwndproc.cpp,v 1.1 3 2000-02-16 14:34:15sandervl Exp $ */1 /* $Id: defwndproc.cpp,v 1.14 2000-09-05 19:20:33 sandervl Exp $ */ 2 2 3 3 /* … … 32 32 Win32BaseWindow *window; 33 33 34 dprintf2(("DefWindowProcA %x %x %x %x", hwnd, Msg, wParam, lParam)); 34 35 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 35 36 if(!window) { … … 45 46 Win32BaseWindow *window; 46 47 48 dprintf2(("DefWindowProcW %x %x %x %x", hwnd, Msg, wParam, lParam)); 47 49 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 48 50 if(!window) { -
trunk/src/user32/pmwindow.cpp
r4140 r4194 1 /* $Id: pmwindow.cpp,v 1.10 2 2000-09-01 01:36:15 phallerExp $ */1 /* $Id: pmwindow.cpp,v 1.103 2000-09-05 19:20:34 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 377 377 } 378 378 379 if(pswp->fl & SWP_ACTIVATE)380 {381 if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE)) {382 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd);383 }384 }385 386 379 if((pswp->fl & (SWP_MOVE | SWP_SIZE)) && !(win32wnd->getStyle() & WS_MINIMIZE_W)) 387 380 { … … 458 451 } 459 452 453 if(pswp->fl & SWP_ACTIVATE) 454 { 455 if(!(WinQueryWindowUShort(hwnd,QWS_FLAGS) & FF_ACTIVE)) { 456 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 457 } 458 } 459 460 460 PosChangedEnd: 461 461 RestoreOS2TIB(); … … 590 590 } 591 591 592 //is sent to both windows gaining and loosing the focus 593 case WM_FOCUSCHANGE: 594 { 595 HWND hwndFocus = (HWND)mp1; 596 HWND hwndLoseFocus, hwndGainFocus; 597 USHORT usSetFocus = SHORT1FROMMP(mp2); 598 USHORT fsFocusChange = SHORT2FROMMP(mp2); 599 600 rc = 0; 601 dprintf(("OS2: WM_FOCUSCHANGE (start) %x %x %x %x", win32wnd->getWindowHandle(), hwndFocus, usSetFocus, fsFocusChange)); 602 RestoreOS2TIB(); 603 if(usSetFocus) { 604 hwndGainFocus = hwnd; 605 hwndLoseFocus = hwndFocus; 606 } 607 else { 608 hwndGainFocus = hwndFocus; 609 hwndLoseFocus = hwnd; 610 } 611 612 if(usSetFocus) 613 { 614 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus); 615 if(!(fsFocusChange & FC_NOSETACTIVE)) 616 { 617 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 618 { 619 if(winfocus) 620 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 621 else 622 WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 623 } 624 } 625 //SvL: Check if window is still valid 626 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 627 if(win32wnd == NULL) 628 return (MRESULT)rc; 629 630 if(!(fsFocusChange & FC_NOSETACTIVE)) 631 { 632 Win32BaseWindow *topparent = win32wnd->GetTopParent(); 633 if(!winfocus || (winfocus->GetTopParent() != topparent)) 634 { 635 if(!(fsFocusChange & FC_NOBRINGTOTOP)) 636 { 637 if(topparent) { 638 //put window at the top of z order 639 WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER); 640 } 641 } 642 643 // PH 2000/09/01 Netscape 4.7 644 // check if topparent is valid 645 if (topparent) 646 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 647 } 648 } 649 //SvL: Check if window is still valid 650 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 651 if(win32wnd == NULL) 652 return (MRESULT)rc; 653 654 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection 655 if(!(fsFocusChange & FC_NOSETSELECTION)) { 656 WinSendMsg(hwndGainFocus, WM_SETSELECTION, (MPARAM)1, (MPARAM)0); 657 } 658 659 if(!(fsFocusChange & FC_NOSETFOCUS)) { 660 WinSendMsg(hwndGainFocus, WM_SETFOCUS, (MPARAM)hwndLoseFocus, (MPARAM)1); 661 } 662 } 663 else /* no usSetFocus */ 664 { 665 if(!(fsFocusChange & FC_NOLOSEFOCUS)) { 666 WinSendMsg(hwndLoseFocus, WM_SETFOCUS, (MPARAM)hwndGainFocus, (MPARAM)0); 667 } 668 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection 669 if(!(fsFocusChange & FC_NOLOSESELECTION)) { 670 WinSendMsg(hwndLoseFocus, WM_SETSELECTION, (MPARAM)0, (MPARAM)0); 671 } 672 //SvL: Check if window is still valid 673 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 674 if(win32wnd == NULL) { 675 return (MRESULT)rc; 676 } 677 678 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus); 679 if(!(fsFocusChange & FC_NOLOSEACTIVE)) 680 { 681 Win32BaseWindow *topparent = win32wnd->GetTopParent(); 682 683 if(!winfocus || (winfocus->GetTopParent() != topparent)) 684 { 685 // PH 2000/09/01 Netscape 4.7 686 // check if topparent is valid 687 if (topparent) 688 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus); 689 } 690 } 691 //SvL: Check if window is still valid 692 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 693 if(win32wnd == NULL) 694 return (MRESULT)rc; 695 696 if(!(fsFocusChange & FC_NOSETACTIVE)) 697 { 698 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) 699 { 700 if(winfocus) 701 { 702 // PH 2000/09/01 Netscape 4.7 703 // check if topparent is valid 704 Win32BaseWindow *topparent = winfocus->GetTopParent(); 705 if (topparent) 706 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 707 } 708 else 709 WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus); 710 } 711 } 712 } 713 714 715 #ifdef DEBUG 716 SetWin32TIB(); 717 dprintf(("OS2: WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2)); 718 RestoreOS2TIB(); 719 #endif 720 return (MRESULT)rc; 721 } 722 592 723 //************************************************************************** 593 724 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen … … 753 884 } 754 885 #endif 755 756 case WM_FOCUSCHANGE:757 {758 HWND hwndFocus = (HWND)mp1;759 HWND hwndLoseFocus, hwndGainFocus;760 USHORT usSetFocus = SHORT1FROMMP(mp2);761 USHORT fsFocusChange = SHORT2FROMMP(mp2);762 763 dprintf(("OS2: WM_FOCUSCHANGE (start) %x %x %x %x", win32wnd->getWindowHandle(), hwndFocus, usSetFocus, fsFocusChange));764 RestoreOS2TIB();765 if(usSetFocus) {766 hwndGainFocus = hwnd;767 hwndLoseFocus = hwndFocus;768 }769 else {770 hwndGainFocus = hwndFocus;771 hwndLoseFocus = hwnd;772 }773 if(!(fsFocusChange & FC_NOLOSEFOCUS)) {774 WinSendMsg(hwndLoseFocus, WM_SETFOCUS, (MPARAM)hwndGainFocus, (MPARAM)0);775 }776 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection777 if(!(fsFocusChange & FC_NOLOSESELECTION)) {778 WinSendMsg(hwndLoseFocus, WM_SETSELECTION, (MPARAM)0, (MPARAM)0);779 }780 //SvL: Check if window is still valid781 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);782 if(win32wnd == NULL) {783 return (MRESULT)rc;784 }785 786 787 if(usSetFocus)788 {789 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus);790 if(!(fsFocusChange & FC_NOLOSEACTIVE))791 {792 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent()))793 {794 if(winfocus)795 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);796 else797 WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);798 }799 }800 //SvL: Check if window is still valid801 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);802 if(win32wnd == NULL)803 return (MRESULT)rc;804 805 if(!(fsFocusChange & FC_NOSETACTIVE))806 {807 Win32BaseWindow *topparent = win32wnd->GetTopParent();808 if(!winfocus || (winfocus->GetTopParent() != topparent))809 {810 if(!(fsFocusChange & FC_NOBRINGTOTOP))811 {812 if(topparent) {813 //put window at the top of z order814 WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);815 }816 }817 818 // PH 2000/09/01 Netscape 4.7819 // check if topparent is valid820 if (topparent)821 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);822 }823 }824 }825 else /* no usSetFocus */826 {827 Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus);828 if(!(fsFocusChange & FC_NOLOSEACTIVE))829 {830 Win32BaseWindow *topparent = win32wnd->GetTopParent();831 832 if(!winfocus || (winfocus->GetTopParent() != topparent))833 {834 // PH 2000/09/01 Netscape 4.7835 // check if topparent is valid836 if (topparent)837 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);838 }839 }840 //SvL: Check if window is still valid841 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);842 if(win32wnd == NULL)843 return (MRESULT)rc;844 845 if(!(fsFocusChange & FC_NOSETACTIVE))846 {847 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent()))848 {849 if(winfocus)850 {851 // PH 2000/09/01 Netscape 4.7852 // check if topparent is valid853 Win32BaseWindow *topparent = winfocus->GetTopParent();854 if (topparent)855 WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);856 }857 else858 WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);859 }860 }861 }862 863 864 //TODO: Don't send WM_SETSELECTION to child window if frame already has selection865 if(!(fsFocusChange & FC_NOSETSELECTION)) {866 WinSendMsg(hwndGainFocus, WM_SETSELECTION, (MPARAM)1, (MPARAM)0);867 }868 869 if(!(fsFocusChange & FC_NOSETFOCUS)) {870 WinSendMsg(hwndGainFocus, WM_SETFOCUS, (MPARAM)hwndLoseFocus, (MPARAM)1);871 }872 #ifdef DEBUG873 SetWin32TIB();874 dprintf(("OS2: WM_FOCUSCHANGE (end) %x %x %x", win32wnd->getWindowHandle(), mp1, mp2));875 RestoreOS2TIB();876 #endif877 return (MRESULT)rc;878 }879 886 880 887 case WM_QUERYTRACKINFO: -
trunk/src/user32/win32class.cpp
r3702 r4194 1 /* $Id: win32class.cpp,v 1.1 7 2000-06-13 21:26:29sandervl Exp $ */1 /* $Id: win32class.cpp,v 1.18 2000-09-05 19:20:35 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Class Managment Code for OS/2 … … 425 425 ULONG rc; 426 426 427 if(classNameA) {428 dprintf2(("Win32WndClass::setClassLongA %s: %d %x", classNameA, index, lNewVal));429 }430 else dprintf2(("Win32WndClass::setClassLongA %d: %d %x", classAtom, index, lNewVal));431 427 switch(index) { 432 428 case GCL_CBCLSEXTRA: //TODO (doesn't affect allocated classes, so what does it do?) … … 467 463 break; 468 464 case GCL_WNDPROC: 465 //Note: Type of SetWindowLong determines new window proc type 466 // UNLESS the new window proc has already been registered 467 // (use the old type in that case) 468 // (VERIFIED in NT 4, SP6) 469 //TODO: Is that also true for GCL_WNDPROC??????????????? 469 470 rc = (LONG)WINPROC_GetProc(windowProc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A ); 470 471 WINPROC_SetProc((HWINDOWPROC *)&windowProc, (WNDPROC)lNewVal, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_CLASS ); … … 477 478 rc = userClassLong[index]; 478 479 userClassLong[index] = lNewVal; 479 return(rc);480 break; 480 481 } 481 482 SetLastError(ERROR_INVALID_PARAMETER); 483 if(classNameA) { 484 dprintf2(("WARNING: Win32WndClass::setClassLongA %s: %d %x -> wrong INDEX", classNameA, index, lNewVal)); 485 } 486 else dprintf2(("WARNING: Win32WndClass::setClassLongA %d: %d %x -> wrong INDEX", classAtom, index, lNewVal)); 482 487 return 0; 483 488 } 489 SetLastError(ERROR_SUCCESS); 490 if(classNameA) { 491 dprintf2(("Win32WndClass::setClassLongA %s: %d %x returned %x", classNameA, index, lNewVal, rc)); 492 } 493 else dprintf2(("Win32WndClass::setClassLongA %d: %d %x returned %x", classAtom, index, lNewVal, rc)); 484 494 return(rc); 485 495 } -
trunk/src/user32/win32wbase.cpp
r4188 r4194 1 /* $Id: win32wbase.cpp,v 1.21 0 2000-09-04 18:23:56 sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.211 2000-09-05 19:20:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 666 666 } 667 667 668 if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 668 //cs is ascii version of create structure. so use SendInternalMessageA 669 if(SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 669 670 { 670 671 RECT tmpRect; … … 705 706 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 706 707 } 707 708 708 if( (getStyle() & WS_CHILD) && !(getExStyle() & WS_EX_NOPARENTNOTIFY) ) 709 709 { 710 710 /* Notify the parent window only */ 711 SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle()); 711 if(getParent() && getParent()->IsWindowDestroyed() == FALSE) 712 { 713 getParent()->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle()); 714 } 712 715 if(!::IsWindow(getWindowHandle())) 713 716 { … … 3013 3016 LONG oldval; 3014 3017 3015 dprintf2(("SetWindowLong%c %x %d %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value));3016 3018 switch(index) { 3017 3019 case GWL_EXSTYLE: … … 3019 3021 STYLESTRUCT ss; 3020 3022 3021 if(dwExStyle == value) 3022 return value; 3023 3023 if(dwExStyle == value) { 3024 oldval = value; 3025 break; 3026 } 3024 3027 ss.styleOld = dwExStyle; 3025 3028 ss.styleNew = value; … … 3028 3031 setExStyle(ss.styleNew); 3029 3032 SendInternalMessageA(WM_STYLECHANGED,GWL_EXSTYLE,(LPARAM)&ss); 3030 return ss.styleOld; 3033 oldval = ss.styleOld; 3034 break; 3031 3035 } 3032 3036 case GWL_STYLE: … … 3036 3040 //SvL: TODO: Can you change minimize or maximize status here too? 3037 3041 3038 if(dwStyle == value) 3039 return value; 3040 3042 if(dwStyle == value) { 3043 oldval = value; 3044 break; 3045 } 3041 3046 value &= ~(WS_CHILD|WS_VISIBLE); /* Some bits can't be changed this way (WINE) */ 3042 3047 ss.styleOld = getStyle(); … … 3051 3056 PrintWindowStyle(ss.styleNew, 0); 3052 3057 #endif 3053 return ss.styleOld; 3058 oldval = ss.styleOld; 3059 break; 3054 3060 } 3055 3061 case GWL_WNDPROC: … … 3065 3071 oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A); 3066 3072 WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, type, WIN_PROC_WINDOW); 3067 return oldval;3073 break; 3068 3074 } 3069 3075 case GWL_HINSTANCE: 3070 3076 oldval = hInstance; 3071 3077 hInstance = value; 3072 return oldval;3078 break; 3073 3079 3074 3080 case GWL_HWNDPARENT: 3075 return SetParent((HWND)value); 3081 oldval = SetParent((HWND)value); 3082 break; 3076 3083 3077 3084 case GWL_ID: 3078 3085 oldval = getWindowId(); 3079 3086 setWindowId(value); 3080 return oldval;3087 break; 3081 3088 3082 3089 case GWL_USERDATA: 3083 3090 oldval = userData; 3084 3091 userData = value; 3085 return oldval;3092 break; 3086 3093 3087 3094 default: … … 3090 3097 oldval = userWindowLong[index/4]; 3091 3098 userWindowLong[index/4] = value; 3092 return oldval;3099 break; 3093 3100 } 3101 dprintf(("WARNING: SetWindowLong%c %x %d %x returned %x INVALID index!", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value)); 3094 3102 SetLastError(ERROR_INVALID_PARAMETER); 3095 3103 return 0; 3096 3104 } 3105 SetLastError(ERROR_SUCCESS); 3106 dprintf2(("SetWindowLong%c %x %d %x returned %x", (fUnicode) ? 'W' : 'A', getWindowHandle(), index, value, oldval)); 3107 return oldval; 3097 3108 } 3098 3109 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r3663 r4194 1 /* $Id: win32wbase.h,v 1.9 8 2000-06-07 21:45:52sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.99 2000-09-05 19:20:37 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 428 428 RECT *newClientRect ); 429 429 430 LRESULT SendInternalMessage(ULONG msg, WPARAM wParam, LPARAM lParam)431 {432 if(isUnicode)433 return SendInternalMessageW(msg, wParam, lParam);434 else return SendInternalMessageA(msg, wParam, lParam);435 }436 430 #else 437 431 friend BOOL OS2ToWinMsgTranslate(void *pThdb, QMSG *os2Msg, MSG *winMsg, BOOL isUnicode, BOOL fTranslateExtraMsgs); -
trunk/src/user32/winproc.cpp
r4188 r4194 1 /* $Id: winproc.cpp,v 1. 5 2000-09-04 18:23:58 sandervl Exp $ */1 /* $Id: winproc.cpp,v 1.6 2000-09-05 19:20:38 sandervl Exp $ */ 2 2 /* 3 3 * Window procedure callbacks … … 302 302 WINDOWPROC *proc = WINPROC_GetPtr( func ); 303 303 304 if(proc) { 305 dprintf2(("CallWindowProcA %x %x %x %x %x -> proc %x, type %d, org func %x", func, hwnd, msg, wParam, lParam, proc, proc->type, WINPROC_THUNKPROC(proc))); 306 } 307 else dprintf2(("CallWindowProcA %x %x %x %x %x (unknown proc)", func, hwnd, msg, wParam, lParam)); 308 304 309 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromHandle(hwnd); 305 310 if(!window) { … … 310 315 311 316 if (!proc) return func(hwnd, msg, wParam, lParam ); 312 313 #if testing314 func = WINPROC_GetProc( (HWINDOWPROC)proc, WIN_PROC_32A );315 return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam );316 #endif317 317 318 318 switch(proc->type) … … 337 337 WINDOWPROC *proc = WINPROC_GetPtr( func ); 338 338 339 if(proc) { 340 dprintf2(("CallWindowProcW %x %x %x %x %x -> proc %x, type %d, org func %x", func, hwnd, msg, wParam, lParam, proc, proc->type, WINPROC_THUNKPROC(proc))); 341 } 342 else dprintf2(("CallWindowProcW %x %x %x %x %x (unknown proc)", func, hwnd, msg, wParam, lParam)); 343 339 344 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromHandle(hwnd); 340 345 if(!window) { … … 345 350 346 351 if (!proc) return func( hwnd, msg, wParam, lParam ); 347 348 #if testing349 func = WINPROC_GetProc( (HWINDOWPROC)proc, WIN_PROC_32W );350 return WINPROC_CallWndProc( func, hwnd, msg, wParam, lParam );351 #endif352 352 353 353 switch(proc->type)
Note:
See TracChangeset
for help on using the changeset viewer.