Ignore:
Timestamp:
Jan 1, 2003, 3:29:45 PM (23 years ago)
Author:
sandervl
Message:

Fixes for windows with an iconless class and WS_EX_DLGMODALFRAME style. (they shouldn't have a system menu)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/win32wbasenonclient.cpp

    r9563 r9575  
    1 /* $Id: win32wbasenonclient.cpp,v 1.45 2002-12-29 17:17:16 sandervl Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.46 2003-01-01 14:29:45 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    907907
    908908  if(fOS2Look) {
    909       if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
    910            fOS2Look != OS2_APPEARANCE_SYSMENU)
     909      //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu
     910      if((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
     911         !(!windowClass->getIcon() && (dwExStyle & WS_EX_DLGMODALFRAME)) &&
     912         fOS2Look != OS2_APPEARANCE_SYSMENU)
    911913      {
    912914         HICON hSysIcon = IconForWindow(ICON_SMALL);
     
    986988  }
    987989
    988   if ((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW))
     990  //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu
     991  if((dwStyle & WS_SYSMENU) && !(dwExStyle & WS_EX_TOOLWINDOW) &&
     992     !(!windowClass->getIcon() && (dwExStyle & WS_EX_DLGMODALFRAME)))
    989993  {
    990994    if (DrawSysButton(memDC,&r))
     
    15501554  return DrawCaptionTemp(hwnd,hdc,rect,hFont,hIcon,(LPWSTR)str,uFlags,TRUE);
    15511555}
    1552 
     1556#if 0
     1557//Control helpers
     1558/***********************************************************************
     1559 *           NC_GetSysPopupPos
     1560 */
     1561void NC_GetSysPopupPos( HWND hwnd, RECT* rect )
     1562{
     1563    if (IsIconic(hwnd)) GetWindowRect( hwnd, rect );
     1564    else
     1565    {
     1566#ifdef __WIN32OS2__
     1567        Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1568        if (!win32wnd) return;
     1569
     1570        win32wnd->GetSysPopupPos(rect);
     1571
     1572        RELEASE_WNDOBJ(win32wnd);
     1573#else
     1574        WND *wndPtr = WIN_FindWndPtr( hwnd );
     1575        if (!wndPtr) return;
     1576
     1577        NC_GetInsideRect( hwnd, rect );
     1578        OffsetRect( rect, wndPtr->rectWindow.left, wndPtr->rectWindow.top);
     1579        if (wndPtr->dwStyle & WS_CHILD)
     1580            ClientToScreen( GetParent(hwnd), (POINT *)rect );
     1581        if (TWEAK_WineLook == WIN31_LOOK) {
     1582            rect->right = rect->left + GetSystemMetrics(SM_CXSIZE);
     1583            rect->bottom = rect->top + GetSystemMetrics(SM_CYSIZE);
     1584        }
     1585        else {
     1586            rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1;
     1587            rect->bottom = rect->top + GetSystemMetrics(SM_CYCAPTION) - 1;
     1588        }
     1589        WIN_ReleaseWndPtr( wndPtr );
     1590#endif
     1591    }
     1592}
     1593//*****************************************************************************
     1594//*****************************************************************************
     1595BOOL NC_DrawSysButton95 (HWND hwnd, HDC hdc, BOOL down)
     1596{
     1597    BOOL ret;
     1598
     1599    Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1600    if (!win32wnd) return FALSE;
     1601
     1602    ret = win32wnd->DrawSysButton(hwnd, hdc);
     1603
     1604    RELEASE_WNDOBJ(win32wnd);
     1605
     1606    return ret;
     1607}
     1608#endif
Note: See TracChangeset for help on using the changeset viewer.