Ignore:
Timestamp:
Oct 15, 2002, 11:18:12 AM (23 years ago)
Author:
sandervl
Message:

PF: Disable close button & close item in system menu for windows with SC_NOCLOSE class style

File:
1 edited

Legend:

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

    r9256 r9345  
    1 /* $Id: oslibwin.cpp,v 1.128 2002-09-17 10:24:02 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.129 2002-10-15 09:18:10 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    103103    if(fOS2Look && *hwndFrame) {
    104104        FCData.flCreateFlags = dwOSFrameStyle;
    105 //        FCData.flCreateFlags = FCF_TITLEBAR|FCF_SYSMENU|FCF_MINMAX;
    106105        WinCreateFrameControls(*hwndFrame, &FCData, NULL);
    107106    }
     
    156155//******************************************************************************
    157156BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle,
    158                                    DWORD dwExStyle, HICON hSysMenuIcon)
     157                                   DWORD dwExStyle, HICON hSysMenuIcon, BOOL drawCloseButton)
    159158{
    160159  SWP  swp[3];
     
    186185          i++;
    187186      }
     187
    188188  }
    189189  else
     
    209209              swp[i].cx -= minmaxwidth/2;
    210210          }
    211           //there is no close button in warp 3
    212           if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3) {
     211          //there is no close button in warp 3 and sometimes we do not
     212          //have close button as well
     213          if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3 && drawCloseButton) {
    213214              swp[i].cx -= minmaxwidth/2;
    214215          }
     
    238239              swp[i].cx += minmaxwidth/2;
    239240          }
    240           //there is no close button in warp 3
    241           if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3) {
     241          //there is no close button in warp 3 and sometimes we do not have
     242          //close button as well
     243          if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3 && drawCloseButton) {
    242244              swp[i].cx += minmaxwidth/2;
    243245          }
     
    975977  // the first entry returned is always the window list itself
    976978  if (WinQuerySwitchList(0, &swblk, sizeof(SWBLOCK)) > 0)
    977     WinSetActiveWindow(HWND_DESKTOP, swblk.aswentry[0].swctl.hwnd);
     979     WinSetActiveWindow(HWND_DESKTOP, swblk.aswentry[0].swctl.hwnd);
     980//      WinShowWindow(swblk.aswentry[0].swctl.hwnd, TRUE);
    978981}
    979982//******************************************************************************
     
    10821085            if (WinQueryActiveWindow(HWND_DESKTOP) == hwndFrame)
    10831086              WinSendMsg(WinWindowFromID(hwndFrame, FID_TITLEBAR), TBM_SETHILITE, (MPARAM)1, 0);
     1087
    10841088       }
    10851089   } // os2look
     1090}
     1091
     1092//******************************************************************************
     1093//******************************************************************************
     1094BOOL OSLibChangeCloseButtonState(HWND hwndFrame, BOOL State)
     1095{
     1096    return WinEnableMenuItem(WinWindowFromID(hwndFrame, FID_SYSMENU), SC_CLOSE, State);
    10861097}
    10871098//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.