Changeset 325 for trunk/src/user32/new/win32wnd.cpp
- Timestamp:
- Jul 18, 1999, 12:39:52 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/win32wnd.cpp
r324 r325 1 /* $Id: win32wnd.cpp,v 1. 8 1999-07-17 18:30:51 sandervl Exp $ */1 /* $Id: win32wnd.cpp,v 1.9 1999-07-18 10:39:51 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 28 28 #include <oslibwin.h> 29 29 #include <oslibutil.h> 30 #include <oslibgdi.h> 30 31 31 32 #define HAS_DLGFRAME(style,exStyle) \ … … 383 384 maxPos.x = rectWindow.left; maxPos.y = rectWindow.top; 384 385 385 if( sendMessage(WM_NCCREATE, 0, (LPARAM)cs) )386 if(SendInternalMessage(WM_NCCREATE, 0, (LPARAM)cs) ) 386 387 { 387 388 SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient ); … … 389 390 maxPos.y - rectWindow.top); 390 391 dprintf(("Sending WM_CREATE")); 391 if( ( sendMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 )392 if( (SendInternalMessage(WM_CREATE, 0, (LPARAM)cs )) != -1 ) 392 393 { 393 394 SetWindowPos(HWND_TOP, rectClient.left, rectClient.top, … … 430 431 if( dwStyle & WS_MINIMIZE ) 431 432 { 432 if( !Send MessageA(WM_QUERYOPEN, 0, 0L ) )433 if( !SendInternalMessageA(WM_QUERYOPEN, 0, 0L ) ) 433 434 return (SWP_NOSIZE | SWP_NOMOVE); 434 435 swpFlags |= SWP_NOCOPYBITS; … … 570 571 // } 571 572 572 Send MessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax );573 SendInternalMessageA(WM_GETMINMAXINFO, 0, (LPARAM)&MinMax ); 573 574 574 575 /* Some sanity checks */ … … 614 615 params.lppos = &winposCopy; 615 616 } 616 result = Send MessageA(WM_NCCALCSIZE, calcValidRect,617 (LPARAM)¶ms );617 result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect, 618 (LPARAM)¶ms ); 618 619 *newClientRect = params.rgrc[0]; 619 620 return result; … … 624 625 { 625 626 OS2Hwnd = hwndOS2; 626 return Send MessageA(WM_CREATE, 0, initParam);627 return SendInternalMessageA(WM_CREATE, 0, initParam); 627 628 } 628 629 //****************************************************************************** … … 630 631 ULONG Win32Window::MsgQuit() 631 632 { 632 return Send MessageA(WM_QUIT, 0, 0);633 return SendInternalMessageA(WM_QUIT, 0, 0); 633 634 } 634 635 //****************************************************************************** … … 636 637 ULONG Win32Window::MsgClose() 637 638 { 638 return Send MessageA(WM_CLOSE, 0, 0);639 return SendInternalMessageA(WM_CLOSE, 0, 0); 639 640 } 640 641 //****************************************************************************** … … 644 645 ULONG rc; 645 646 646 rc = Send MessageA(WM_DESTROY, 0, 0);647 rc = SendInternalMessageA(WM_DESTROY, 0, 0); 647 648 delete this; 648 649 return rc; … … 652 653 ULONG Win32Window::MsgEnable(BOOL fEnable) 653 654 { 654 return Send MessageA(WM_ENABLE, fEnable, 0);655 return SendInternalMessageA(WM_ENABLE, fEnable, 0); 655 656 } 656 657 //****************************************************************************** … … 659 660 ULONG Win32Window::MsgShow(BOOL fShow) 660 661 { 661 return Send MessageA(WM_SHOWWINDOW, fShow, 0);662 return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0); 662 663 } 663 664 //****************************************************************************** … … 683 684 else fwSizeType = SIZE_RESTORED; 684 685 685 return Send MessageA(WM_SIZE, fwSizeType, MAKELONG((USHORT)width, (USHORT)height));686 return SendInternalMessageA(WM_SIZE, fwSizeType, MAKELONG((USHORT)width, (USHORT)height)); 686 687 } 687 688 //****************************************************************************** … … 689 690 ULONG Win32Window::MsgActivate(BOOL fActivate, HWND hwnd) 690 691 { 691 return Send MessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd);692 return SendInternalMessageA(WM_ACTIVATE, (fActivate) ? WA_ACTIVE : WA_INACTIVE, hwnd); 692 693 } 693 694 //****************************************************************************** … … 695 696 ULONG Win32Window::MsgSetFocus(HWND hwnd) 696 697 { 697 return Send MessageA(WM_SETFOCUS, hwnd, 0);698 return SendInternalMessageA(WM_SETFOCUS, hwnd, 0); 698 699 } 699 700 //****************************************************************************** … … 701 702 ULONG Win32Window::MsgKillFocus(HWND hwnd) 702 703 { 703 return Send MessageA(WM_KILLFOCUS, hwnd, 0);704 return SendInternalMessageA(WM_KILLFOCUS, hwnd, 0); 704 705 } 705 706 //****************************************************************************** … … 732 733 return 1; 733 734 } 734 return Send MessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y)));735 return SendInternalMessageA(win32msg, 0, MAKELONG(x, MapOS2ToWin32Y(OS2Hwnd, y))); 735 736 } 736 737 //****************************************************************************** … … 738 739 ULONG Win32Window::MsgPaint(ULONG tmp1, ULONG tmp2) 739 740 { 740 return Send MessageA(WM_PAINT, 0, 0);741 return SendInternalMessageA(WM_PAINT, 0, 0); 741 742 } 742 743 //****************************************************************************** … … 744 745 ULONG Win32Window::MsgEraseBackGround(ULONG hps) 745 746 { 746 return SendMessageA(WM_ERASEBKGND, hps, 0); 747 return SendInternalMessageA(WM_ERASEBKGND, hps, 0); 748 } 749 //****************************************************************************** 750 //****************************************************************************** 751 ULONG Win32Window::MsgSetText(LPSTR lpsz, LONG cch) 752 { 753 if(isUnicode) { 754 return SendInternalMessageW(WM_SETTEXT, 0, (LPARAM)lpsz); 755 } 756 else return SendInternalMessageA(WM_SETTEXT, 0, (LPARAM)lpsz); 747 757 } 748 758 //****************************************************************************** … … 787 797 } 788 798 //****************************************************************************** 789 //todo, unicode msgs790 799 //****************************************************************************** 791 800 LRESULT Win32Window::SendMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam) … … 823 832 NotifyParent(Msg, wParam, lParam); 824 833 return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 834 835 default: 836 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 837 } 838 } 839 //****************************************************************************** 840 //Called as a result of an OS/2 message 841 //****************************************************************************** 842 LRESULT Win32Window::SendInternalMessageA(ULONG Msg, WPARAM wParam, LPARAM lParam) 843 { 844 if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE) 845 dprintf(("SendInternalMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam)); 846 847 if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg 848 return(0); 849 } 850 switch(Msg) 851 { 852 case WM_CREATE: 853 { 854 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) { 855 dprintf(("WM_NCCREATE returned FALSE\n")); 856 return(0); //don't create window 857 } 858 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 859 dprintf(("WM_CREATE returned FALSE\n")); 860 return(0); //don't create window 861 } 862 NotifyParent(Msg, wParam, lParam); 863 864 return(1); 865 } 866 case WM_LBUTTONDOWN: 867 case WM_MBUTTONDOWN: 868 case WM_RBUTTONDOWN: 869 NotifyParent(Msg, wParam, lParam); 870 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 871 872 case WM_DESTROY: 873 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 874 NotifyParent(Msg, wParam, lParam); 875 return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 876 default: 877 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 878 } 879 } 880 //****************************************************************************** 881 //Called as a result of an OS/2 message 882 //todo, unicode msgs (WM_SETTEXT etc) 883 //****************************************************************************** 884 LRESULT Win32Window::SendInternalMessageW(ULONG Msg, WPARAM wParam, LPARAM lParam) 885 { 886 if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE) 887 dprintf(("SendInternalMessageW %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam)); 888 889 if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg 890 return(0); 891 } 892 switch(Msg) 893 { 894 case WM_CREATE: 895 { 896 if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) { 897 dprintf(("WM_NCCREATE returned FALSE\n")); 898 return(0); //don't create window 899 } 900 if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) { 901 dprintf(("WM_CREATE returned FALSE\n")); 902 return(0); //don't create window 903 } 904 NotifyParent(Msg, wParam, lParam); 905 906 return(1); 907 } 908 case WM_LBUTTONDOWN: 909 case WM_MBUTTONDOWN: 910 case WM_RBUTTONDOWN: 911 NotifyParent(Msg, wParam, lParam); 912 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); 913 914 case WM_DESTROY: 915 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0); 916 NotifyParent(Msg, wParam, lParam); 917 return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0); 825 918 default: 826 919 return win32wndproc(getWindowHandle(), Msg, wParam, lParam); … … 875 968 if(parentwindow) { 876 969 if(Msg == WM_CREATE || Msg == WM_DESTROY) { 877 parentwindow->Send MessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());970 parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle()); 878 971 } 879 else parentwindow->Send MessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );972 else parentwindow->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam ); 880 973 } 881 974 } … … 908 1001 ULONG showstate = 0; 909 1002 1003 dprintf(("ShowWindow %x", nCmdShow)); 910 1004 switch(nCmdShow) 911 1005 { … … 942 1036 break; 943 1037 } 944 return OSLibWinShowWindow(OS2Hwnd , showstate);1038 return OSLibWinShowWindow(OS2HwndFrame, showstate); 945 1039 } 946 1040 //****************************************************************************** … … 994 1088 setstate |= SWPOS_SHOW; 995 1089 996 return OSLibWinSetWindowPos(OS2Hwnd , hwndInsertAfter, x, y, cx, cy, setstate);1090 return OSLibWinSetWindowPos(OS2HwndFrame, hwndInsertAfter, x, y, cx, cy, setstate); 997 1091 } 998 1092 //****************************************************************************** … … 1061 1155 BOOL Win32Window::UpdateWindow() 1062 1156 { 1063 RECT Lrect;1064 1065 if(OSLibWinQueryUpdateRect(OS2Hwnd, (PVOID)&rect))1157 RECT rect; 1158 1159 if(OSLibWinQueryUpdateRect(OS2Hwnd, &rect)) 1066 1160 {//update region not empty 1067 Send MessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0);1161 SendInternalMessageA((isIcon) ? WM_PAINTICON : WM_PAINT, 0, 0); 1068 1162 } 1069 1163 return TRUE; … … 1181 1275 { 1182 1276 return OSLibWinIsWindowVisible(OS2Hwnd); 1277 } 1278 //****************************************************************************** 1279 //****************************************************************************** 1280 BOOL Win32Window::GetWindowRect(PRECT pRect) 1281 { 1282 // return OSLibWinIsWindowVisible(OS2Hwnd); 1283 } 1284 //****************************************************************************** 1285 //****************************************************************************** 1286 int Win32Window::GetWindowTextLengthA() 1287 { 1288 return OSLibWinQueryWindowTextLength(OS2Hwnd); 1289 } 1290 //****************************************************************************** 1291 //****************************************************************************** 1292 int Win32Window::GetWindowTextA(LPSTR lpsz, int cch) 1293 { 1294 return OSLibWinQueryWindowText(OS2Hwnd, cch, lpsz); 1295 } 1296 //****************************************************************************** 1297 //****************************************************************************** 1298 BOOL Win32Window::SetWindowTextA(LPCSTR lpsz) 1299 { 1300 return OSLibWinSetWindowText(OS2Hwnd, (LPSTR)lpsz); 1183 1301 } 1184 1302 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.