Changeset 1256 for trunk/src/user32/win32wbase.cpp
- Timestamp:
- Oct 12, 1999, 4:47:24 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/win32wbase.cpp (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/win32wbase.cpp
r1253 r1256 1 /* $Id: win32wbase.cpp,v 1.3 6 1999-10-11 20:54:25sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.37 1999-10-12 14:47:23 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 58 58 !(style & (WS_CHILD | WS_POPUP)) 59 59 60 /* bits in the dwKeyData */ 61 #define KEYDATA_ALT 0x2000 62 #define KEYDATA_PREVSTATE 0x4000 63 60 64 void PrintWindowStyle(DWORD dwStyle, DWORD dwExStyle); 61 65 … … 551 555 552 556 //Subclass frame 553 if (isFrameWindow() )557 if (isFrameWindow() && HAS_3DFRAME(dwExStyle)) 554 558 { 555 559 pOldFrameProc = FrameSubclassFrameWindow(this); … … 1086 1090 // bit 24, 1=extended key 1087 1091 // bit 25-28, reserved 1088 lParam |= 0 << 29; // bit 29, key is released, always 0 for WM_KEYUP ?? <- conflict according to the MS docs1092 lParam |= 0 << 29; // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs 1089 1093 lParam |= 1 << 30; // bit 30, previous state, always 1 for a WM_KEYUP message 1090 1094 lParam |= 1 << 31; // bit 31, transition state, always 1 for WM_KEYUP … … 1105 1109 // bit 24, 1=extended key 1106 1110 // bit 25-28, reserved 1107 // bit 29, key is pressed, always 0 for WM_KEYDOWN?? <- conflict according to the MS docs1111 // bit 29, key is released, always 1 for WM_SYSKEYUP ?? <- conflict according to the MS docs 1108 1112 if (keyWasPressed) 1109 1113 lParam |= 1 << 30; // bit 30, previous state, 1 means key was pressed … … 1445 1449 return infoPtr->CurVal; 1446 1450 } 1451 /*********************************************************************** 1452 * NC_HandleSysCommand 1453 * 1454 * Handle a WM_SYSCOMMAND message. Called from DefWindowProc(). 1455 * 1456 * TODO: Not done (see #if 0) 1457 */ 1458 LONG Win32BaseWindow::HandleSysCommand(WPARAM wParam, POINT *pt32) 1459 { 1460 UINT uCommand = wParam & 0xFFF0; 1461 1462 if (getStyle() & WS_CHILD && uCommand != SC_KEYMENU ) 1463 ScreenToClient(getParent()->getWindowHandle(), pt32 ); 1464 1465 switch (uCommand) 1466 { 1467 #if 0 1468 case SC_SIZE: 1469 case SC_MOVE: 1470 NC_DoSizeMove( hwnd, wParam ); 1471 break; 1472 #endif 1473 1474 case SC_MINIMIZE: 1475 ShowWindow(SW_MINIMIZE); 1476 break; 1477 1478 case SC_MAXIMIZE: 1479 ShowWindow(SW_MAXIMIZE); 1480 break; 1481 1482 case SC_RESTORE: 1483 ShowWindow(SW_RESTORE); 1484 break; 1485 1486 case SC_CLOSE: 1487 return SendMessageA(WM_CLOSE, 0, 0); 1488 1489 #if 0 1490 case SC_VSCROLL: 1491 case SC_HSCROLL: 1492 NC_TrackScrollBar( hwnd, wParam, pt32 ); 1493 break; 1494 1495 case SC_MOUSEMENU: 1496 MENU_TrackMouseMenuBar( wndPtr, wParam & 0x000F, pt32 ); 1497 break; 1498 1499 case SC_KEYMENU: 1500 MENU_TrackKbdMenuBar( wndPtr , wParam , pt.x ); 1501 break; 1502 1503 case SC_TASKLIST: 1504 WinExec( "taskman.exe", SW_SHOWNORMAL ); 1505 break; 1506 1507 case SC_SCREENSAVE: 1508 if (wParam == SC_ABOUTWINE) 1509 ShellAboutA(hwnd, "Odin", WINE_RELEASE_INFO, 0); 1510 else 1511 if (wParam == SC_PUTMARK) 1512 dprintf(("Mark requested by user\n")); 1513 break; 1514 1515 case SC_HOTKEY: 1516 case SC_ARRANGE: 1517 case SC_NEXTWINDOW: 1518 case SC_PREVWINDOW: 1519 break; 1520 #endif 1521 } 1522 return 0; 1523 } 1447 1524 //****************************************************************************** 1448 1525 //****************************************************************************** … … 1578 1655 } 1579 1656 case WM_MOUSEMOVE: 1580 return 0;1657 return 1; //Let OS/2 change the mouse cursor back to the default 1581 1658 1582 1659 case WM_WINDOWPOSCHANGED: … … 1634 1711 return HTCLIENT; 1635 1712 1636 #if 0 1713 case WM_SYSCOMMAND: 1714 { 1715 POINT point; 1716 1717 point.x = LOWORD(lParam); 1718 point.y = HIWORD(lParam); 1719 return HandleSysCommand(wParam, &point); 1720 } 1721 1637 1722 case WM_SYSKEYDOWN: 1638 1723 if(HIWORD(lParam) & KEYDATA_ALT) … … 1640 1725 if(wParam == VK_F4) /* try to close the window */ 1641 1726 { 1642 HWND hWnd = WIN_GetTopParent( wndPtr->hwndSelf ); 1643 wndPtr = WIN_FindWndPtr( hWnd ); 1644 if( wndPtr && !(getClass()->getStyle() & CS_NOCLOSE) ) 1645 PostMessage(WM_SYSCOMMAND, SC_CLOSE, 0); 1727 Win32BaseWindow *window = GetTopParent(); 1728 if(window && !(window->getClass()->getStyle() & CS_NOCLOSE) ) 1729 window->PostMessageA(WM_SYSCOMMAND, SC_CLOSE, 0); 1646 1730 } 1647 1731 } 1648 1732 return 0; 1649 #endif 1733 1734 case WM_QUERYOPEN: 1735 case WM_QUERYENDSESSION: 1736 return 1; 1737 1738 case WM_NOTIFYFORMAT: 1739 if (IsUnicode()) return NFR_UNICODE; 1740 else return NFR_ANSI; 1741 1742 case WM_SETICON: 1743 case WM_GETICON: 1744 { 1745 LRESULT result = 0; 1746 int index = GCL_HICON; 1747 1748 if (wParam == ICON_SMALL) 1749 index = GCL_HICONSM; 1750 1751 result = windowClass->getClassLongA(index); 1752 1753 if (Msg == WM_SETICON) 1754 windowClass->setClassLongA(index, lParam); 1755 1756 return result; 1757 } 1650 1758 1651 1759 default: … … 1974 2082 ULONG showstate = 0; 1975 2083 1976 dprintf(("ShowWindow %x ", nCmdShow));2084 dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow)); 1977 2085 if(fFirstShow) { 1978 2086 if(isFrameWindow() && IS_OVERLAPPED(getStyle()) && !isChild()) { … … 2019 2127 break; 2020 2128 } 2129 2021 2130 BOOL rc = OSLibWinShowWindow(OS2HwndFrame, showstate); 2022 2131 return rc; … … 2156 2265 BOOL Win32BaseWindow::IsChild(HWND hwndParent) 2157 2266 { 2158 if(getParent()) {2267 if(getParent()) { 2159 2268 return getParent()->getWindowHandle() == hwndParent; 2160 }2161 else return 0;2269 } 2270 else return 0; 2162 2271 } 2163 2272 //****************************************************************************** … … 2165 2274 HWND Win32BaseWindow::GetTopWindow() 2166 2275 { 2167 return GetWindow(GW_CHILD); 2276 return GetWindow(GW_CHILD); 2277 } 2278 //****************************************************************************** 2279 // Get the top-level parent for a child window. 2280 //****************************************************************************** 2281 Win32BaseWindow *Win32BaseWindow::GetTopParent() 2282 { 2283 Win32BaseWindow *window = this; 2284 2285 while(window && (window->getStyle() & WS_CHILD)) 2286 { 2287 window = window->getParent(); 2288 } 2289 return window; 2168 2290 } 2169 2291 //****************************************************************************** … … 2616 2738 Win32BaseWindow *Win32BaseWindow::GetWindowFromOS2FrameHandle(HWND hwnd) 2617 2739 { 2618 return GetWindowFromOS2Handle(OSLibWinWindowFromID(hwnd,OSLIB_FID_CLIENT));2740 return GetWindowFromOS2Handle(OSLibWinWindowFromID(hwnd,OSLIB_FID_CLIENT)); 2619 2741 } 2620 2742 //****************************************************************************** … … 2622 2744 HWND Win32BaseWindow::Win32ToOS2Handle(HWND hwnd) 2623 2745 { 2624 Win32BaseWindow *window = GetWindowFromHandle(hwnd); 2625 2626 if(window) { 2627 return window->getOS2WindowHandle(); 2628 } 2629 else return hwnd; //OS/2 window handle 2746 Win32BaseWindow *window = GetWindowFromHandle(hwnd); 2747 2748 if(window) { 2749 return window->getOS2WindowHandle(); 2750 } 2751 else return hwnd; 2752 } 2753 //****************************************************************************** 2754 //****************************************************************************** 2755 HWND Win32BaseWindow::Win32ToOS2FrameHandle(HWND hwnd) 2756 { 2757 Win32BaseWindow *window = GetWindowFromHandle(hwnd); 2758 2759 if(window) { 2760 return window->getOS2FrameWindowHandle(); 2761 } 2762 else return hwnd; 2630 2763 } 2631 2764 //****************************************************************************** … … 2633 2766 HWND Win32BaseWindow::OS2ToWin32Handle(HWND hwnd) 2634 2767 { 2635 Win32BaseWindow *window = GetWindowFromOS2Handle(hwnd);2636 2637 if(window) {2638 return window->getWindowHandle();2639 }2640 window = GetWindowFromOS2FrameHandle(hwnd);2641 if(window) {2642 return window->getWindowHandle();2643 }2644 else return hwnd; //OS/2 window handle2768 Win32BaseWindow *window = GetWindowFromOS2Handle(hwnd); 2769 2770 if(window) { 2771 return window->getWindowHandle(); 2772 } 2773 window = GetWindowFromOS2FrameHandle(hwnd); 2774 if(window) { 2775 return window->getWindowHandle(); 2776 } 2777 else return hwnd; //OS/2 window handle 2645 2778 } 2646 2779 //****************************************************************************** … … 2652 2785 char exstyle[256] = ""; 2653 2786 2654 /* Window styles */2655 if(dwStyle & WS_CHILD)2787 /* Window styles */ 2788 if(dwStyle & WS_CHILD) 2656 2789 strcat(style, "WS_CHILD "); 2657 if(dwStyle & WS_POPUP)2790 if(dwStyle & WS_POPUP) 2658 2791 strcat(style, "WS_POPUP "); 2659 if(dwStyle & WS_VISIBLE)2792 if(dwStyle & WS_VISIBLE) 2660 2793 strcat(style, "WS_VISIBLE "); 2661 if(dwStyle & WS_DISABLED)2794 if(dwStyle & WS_DISABLED) 2662 2795 strcat(style, "WS_DISABLED "); 2663 if(dwStyle & WS_CLIPSIBLINGS)2796 if(dwStyle & WS_CLIPSIBLINGS) 2664 2797 strcat(style, "WS_CLIPSIBLINGS "); 2665 if(dwStyle & WS_CLIPCHILDREN)2798 if(dwStyle & WS_CLIPCHILDREN) 2666 2799 strcat(style, "WS_CLIPCHILDREN "); 2667 if(dwStyle & WS_MAXIMIZE)2800 if(dwStyle & WS_MAXIMIZE) 2668 2801 strcat(style, "WS_MAXIMIZE "); 2669 if(dwStyle & WS_MINIMIZE)2802 if(dwStyle & WS_MINIMIZE) 2670 2803 strcat(style, "WS_MINIMIZE "); 2671 if(dwStyle & WS_GROUP)2804 if(dwStyle & WS_GROUP) 2672 2805 strcat(style, "WS_GROUP "); 2673 if(dwStyle & WS_TABSTOP)2806 if(dwStyle & WS_TABSTOP) 2674 2807 strcat(style, "WS_TABSTOP "); 2675 2808 2676 if((dwStyle & WS_CAPTION) == WS_CAPTION)2809 if((dwStyle & WS_CAPTION) == WS_CAPTION) 2677 2810 strcat(style, "WS_CAPTION "); 2678 if(dwStyle & WS_DLGFRAME)2811 if(dwStyle & WS_DLGFRAME) 2679 2812 strcat(style, "WS_DLGFRAME "); 2680 if(dwStyle & WS_BORDER)2813 if(dwStyle & WS_BORDER) 2681 2814 strcat(style, "WS_BORDER "); 2682 2815 2683 if(dwStyle & WS_VSCROLL)2816 if(dwStyle & WS_VSCROLL) 2684 2817 strcat(style, "WS_VSCROLL "); 2685 if(dwStyle & WS_HSCROLL)2818 if(dwStyle & WS_HSCROLL) 2686 2819 strcat(style, "WS_HSCROLL "); 2687 if(dwStyle & WS_SYSMENU)2820 if(dwStyle & WS_SYSMENU) 2688 2821 strcat(style, "WS_SYSMENU "); 2689 if(dwStyle & WS_THICKFRAME)2822 if(dwStyle & WS_THICKFRAME) 2690 2823 strcat(style, "WS_THICKFRAME "); 2691 if(dwStyle & WS_MINIMIZEBOX)2824 if(dwStyle & WS_MINIMIZEBOX) 2692 2825 strcat(style, "WS_MINIMIZEBOX "); 2693 if(dwStyle & WS_MAXIMIZEBOX)2826 if(dwStyle & WS_MAXIMIZEBOX) 2694 2827 strcat(style, "WS_MAXIMIZEBOX "); 2695 2828 2696 if(dwExStyle & WS_EX_DLGMODALFRAME)2829 if(dwExStyle & WS_EX_DLGMODALFRAME) 2697 2830 strcat(exstyle, "WS_EX_DLGMODALFRAME "); 2698 if(dwExStyle & WS_EX_ACCEPTFILES)2831 if(dwExStyle & WS_EX_ACCEPTFILES) 2699 2832 strcat(exstyle, "WS_EX_ACCEPTFILES "); 2700 if(dwExStyle & WS_EX_NOPARENTNOTIFY)2833 if(dwExStyle & WS_EX_NOPARENTNOTIFY) 2701 2834 strcat(exstyle, "WS_EX_NOPARENTNOTIFY "); 2702 if(dwExStyle & WS_EX_TOPMOST)2835 if(dwExStyle & WS_EX_TOPMOST) 2703 2836 strcat(exstyle, "WS_EX_TOPMOST "); 2704 if(dwExStyle & WS_EX_TRANSPARENT)2837 if(dwExStyle & WS_EX_TRANSPARENT) 2705 2838 strcat(exstyle, "WS_EX_TRANSPARENT "); 2706 2839 2707 if(dwExStyle & WS_EX_MDICHILD)2840 if(dwExStyle & WS_EX_MDICHILD) 2708 2841 strcat(exstyle, "WS_EX_MDICHILD "); 2709 if(dwExStyle & WS_EX_TOOLWINDOW)2842 if(dwExStyle & WS_EX_TOOLWINDOW) 2710 2843 strcat(exstyle, "WS_EX_TOOLWINDOW "); 2711 if(dwExStyle & WS_EX_WINDOWEDGE)2844 if(dwExStyle & WS_EX_WINDOWEDGE) 2712 2845 strcat(exstyle, "WS_EX_WINDOWEDGE "); 2713 if(dwExStyle & WS_EX_CLIENTEDGE)2846 if(dwExStyle & WS_EX_CLIENTEDGE) 2714 2847 strcat(exstyle, "WS_EX_CLIENTEDGE "); 2715 if(dwExStyle & WS_EX_CONTEXTHELP)2848 if(dwExStyle & WS_EX_CONTEXTHELP) 2716 2849 strcat(exstyle, "WS_EX_CONTEXTHELP "); 2717 if(dwExStyle & WS_EX_RIGHT)2850 if(dwExStyle & WS_EX_RIGHT) 2718 2851 strcat(exstyle, "WS_EX_RIGHT "); 2719 if(dwExStyle & WS_EX_LEFT)2852 if(dwExStyle & WS_EX_LEFT) 2720 2853 strcat(exstyle, "WS_EX_LEFT "); 2721 if(dwExStyle & WS_EX_RTLREADING)2854 if(dwExStyle & WS_EX_RTLREADING) 2722 2855 strcat(exstyle, "WS_EX_RTLREADING "); 2723 if(dwExStyle & WS_EX_LTRREADING)2856 if(dwExStyle & WS_EX_LTRREADING) 2724 2857 strcat(exstyle, "WS_EX_LTRREADING "); 2725 if(dwExStyle & WS_EX_LEFTSCROLLBAR)2858 if(dwExStyle & WS_EX_LEFTSCROLLBAR) 2726 2859 strcat(exstyle, "WS_EX_LEFTSCROLLBAR "); 2727 if(dwExStyle & WS_EX_RIGHTSCROLLBAR)2860 if(dwExStyle & WS_EX_RIGHTSCROLLBAR) 2728 2861 strcat(exstyle, "WS_EX_RIGHTSCROLLBAR "); 2729 if(dwExStyle & WS_EX_CONTROLPARENT)2862 if(dwExStyle & WS_EX_CONTROLPARENT) 2730 2863 strcat(exstyle, "WS_EX_CONTROLPARENT "); 2731 if(dwExStyle & WS_EX_STATICEDGE)2864 if(dwExStyle & WS_EX_STATICEDGE) 2732 2865 strcat(exstyle, "WS_EX_STATICEDGE "); 2733 if(dwExStyle & WS_EX_APPWINDOW)2866 if(dwExStyle & WS_EX_APPWINDOW) 2734 2867 strcat(exstyle, "WS_EX_APPWINDOW "); 2735 2868 2736 dprintf(("Window style: %x %s", dwStyle, style));2737 dprintf(("Window exStyle: %x %s", dwExStyle, exstyle));2869 dprintf(("Window style: %x %s", dwStyle, style)); 2870 dprintf(("Window exStyle: %x %s", dwExStyle, exstyle)); 2738 2871 } 2739 2872 #endif
Note:
See TracChangeset
for help on using the changeset viewer.
