Ignore:
Timestamp:
Apr 23, 2003, 8:01:01 PM (22 years ago)
Author:
sandervl
Message:

KSO: Properties allocated from shared memory & Fake window updates & SW_SHOWDEFAULT update

File:
1 edited

Legend:

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

    r10013 r10031  
    1 /* $Id: oslibwin.cpp,v 1.142 2003-04-11 15:22:33 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.143 2003-04-23 18:00:58 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    127127//Note: Also check OSLibSetWindowStyle when changing this!!
    128128//******************************************************************************
    129 BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle, 
     129BOOL OSLibWinConvertStyle(ULONG dwStyle, ULONG dwExStyle, ULONG *OSWinStyle,
    130130                          ULONG *OSFrameStyle)
    131131{
     
    144144
    145145  //WS_EX_TOOLWINDOW is incompatible with the OS2Look (titlebar thinner + smaller font)
    146   if(fOS2Look && !(dwExStyle & WS_EX_TOOLWINDOW_W)) 
     146  if(fOS2Look && !(dwExStyle & WS_EX_TOOLWINDOW_W))
    147147  {
    148148      if((dwStyle & WS_CAPTION_W) == WS_CAPTION_W) {
     
    168168//******************************************************************************
    169169//******************************************************************************
    170 BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle, 
    171                                    DWORD dwExStyle, HICON hSysMenuIcon, 
     170BOOL OSLibWinPositionFrameControls(HWND hwndFrame, RECTLOS2 *pRect, DWORD dwStyle,
     171                                   DWORD dwExStyle, HICON hSysMenuIcon,
    172172                                   BOOL drawCloseButton, BOOL fClassIcon)
    173173{
     
    190190      minmaxheight = WinQuerySysValue(HWND_DESKTOP, SV_CYMINMAXBUTTON);
    191191  }
    192  
     192
    193193  if(fOS2Look == OS2_APPEARANCE_SYSMENU) {
    194194      //Note: If no class icon *and* WS_EX_DLGMODALFRAME -> no system menu!!
     
    236236              swp[i].cx -= minmaxwidth/2;
    237237          }
    238           //there is no close button in warp 3 and sometimes we do not 
     238          //there is no close button in warp 3 and sometimes we do not
    239239          //have close button as well
    240240          if((dwStyle & WS_SYSMENU_W) && !fVersionWarp3 && drawCloseButton) {
     
    578578
    579579//******************************************************************************
    580 //@PF This is exactly that weird message PM sends when we maximize window from 
     580//@PF This is exactly that weird message PM sends when we maximize window from
    581581//icon - this coordinates NEVER surface later and this combination of SWP
    582582//commands is useless, yet it starts the correct reaction of maximiztion from
     
    595595 /* @@PF The reason for this weird minimize algorithm is that we are not fully
    596596    using PM for minimization. I.e. we respect all PM messages yet we do mess
    597     so much with some messages that minimization is based partly on vodoo. 
     597    so much with some messages that minimization is based partly on vodoo.
    598598    That is if you try minimize and deactivate in one call it will fail.
    599599    Here we deactivate yourselves and give focus to next window that is
     
    635635{
    636636    ULONG hIconOS2 = GetOS2Icon(hIcon);
    637     if(hIconOS2) 
     637    if(hIconOS2)
    638638       return (BOOL) WinSendMsg(hwnd, WM_SETICON, (MPARAM)hIconOS2, 0);
    639639    return FALSE;
     
    996996//PF: PM Logic approved by numerous testcases shows this:
    997997//There is no other way to tweak FID_MINMAX without deleting it
    998 //Controls are created with size 0,0, invisible and should be immediately 
     998//Controls are created with size 0,0, invisible and should be immediately
    999999//positioned. MINMAX control can't function properly without FID_SYSMENU
    10001000//control if it is present, so we need to recreate BOTH controls.
     
    10061006//leave old, WinCreateFrameControls can't tweak anything.
    10071007
    1008 void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle, 
     1008void OSLibSetWindowStyle(HWND hwndFrame, HWND hwndClient, ULONG dwStyle,
    10091009                         ULONG dwExStyle, ULONG dwOldWindowsStyle)
    10101010{
     
    10121012    ULONG dwOldWinStyle;
    10131013
    1014     int checksum, checksum2; 
     1014    int checksum, checksum2;
    10151015    DWORD dest_tid, dest_pid;
    10161016
     
    10241024    dest_tid = GetWindowThreadProcessId(OS2ToWin32Handle(hwndClient) , &dest_pid );
    10251025
    1026     if (dest_tid != GetCurrentThreadId()) 
     1026    if (dest_tid != GetCurrentThreadId())
    10271027    {
    10281028        dprintf(("OSLibSetWindowStyle: Redirecting Change Frame controls to another thread"));
     
    10341034        minmaxheight = WinQuerySysValue(HWND_DESKTOP, SV_CYMINMAXBUTTON);
    10351035    }
    1036  
     1036
    10371037    if (hwndClient)
    10381038    {
     
    10811081         dwWinStyle |= WS_MAXIMIZED;
    10821082    }
    1083     else 
     1083    else
    10841084      dwWinStyle &= ~WS_MAXIMIZED;
    10851085
     
    10961096            }
    10971097            else
    1098               WinQueryWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR), &rc1);           
     1098              WinQueryWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR), &rc1);
    10991099
    11001100            if((dwStyle & WS_SYSMENU_W) && !(dwExStyle & WS_EX_TOOLWINDOW_W))
     
    11261126              {
    11271127                  OSFrameStyle |= FCF_CLOSEBUTTON;
    1128                   OSFrameStyle |= FCF_SYSMENU;                   
     1128                  OSFrameStyle |= FCF_SYSMENU;
    11291129                  totalwidth += minmaxwidth/2;
    11301130                  dprintf(("close button"));
     
    11321132            }
    11331133       }
    1134        else 
     1134       else
    11351135       {
    1136           if (WinWindowFromID(hwndFrame, FID_TITLEBAR)) 
     1136          if (WinWindowFromID(hwndFrame, FID_TITLEBAR))
    11371137              WinDestroyWindow(WinWindowFromID(hwndFrame, FID_TITLEBAR));
    11381138       }
     
    11401140       if (checksum != checksum2)
    11411141       {
    1142          if (WinWindowFromID(hwndFrame, FID_SYSMENU)) 
     1142         if (WinWindowFromID(hwndFrame, FID_SYSMENU))
    11431143             WinDestroyWindow(WinWindowFromID(hwndFrame, FID_SYSMENU));
    1144          if (WinWindowFromID(hwndFrame, FID_MINMAX)) 
     1144         if (WinWindowFromID(hwndFrame, FID_MINMAX))
    11451145             WinDestroyWindow(WinWindowFromID(hwndFrame, FID_MINMAX));
    11461146       }
     
    11541154            GetWindowTextA(OS2ToWin32Handle(hwndClient), buffer, sizeof(buffer));
    11551155            WinCreateFrameControls(hwndFrame, &FCData, buffer );
    1156  
     1156
    11571157            if (totalwidth != rc3.cx)
    11581158            {
     
    11621162              rc3.x = rc3.x + totalwidth;
    11631163            }
    1164              
    1165             WinSetWindowPos(WinWindowFromID(hwndFrame, FID_MINMAX),0,rc3.x,rc3.y,rc3.cx,rc3.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);     
    1166             WinSetWindowPos(WinWindowFromID(hwndFrame, FID_SYSMENU),0,rc2.x,rc2.y,rc2.cx,rc2.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);     
    1167             WinSetWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR),0,rc1.x,rc1.y,rc1.cx,rc1.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);     
     1164
     1165            WinSetWindowPos(WinWindowFromID(hwndFrame, FID_MINMAX),0,rc3.x,rc3.y,rc3.cx,rc3.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);
     1166            WinSetWindowPos(WinWindowFromID(hwndFrame, FID_SYSMENU),0,rc2.x,rc2.y,rc2.cx,rc2.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);
     1167            WinSetWindowPos(WinWindowFromID(hwndFrame, FID_TITLEBAR),0,rc1.x,rc1.y,rc1.cx,rc1.cy, SWP_MOVE | SWP_SIZE | SWP_SHOW);
    11681168
    11691169            if (WinQueryActiveWindow(HWND_DESKTOP) == hwndFrame)
     
    13451345//******************************************************************************
    13461346//******************************************************************************
     1347
     1348/* 'Private' PM property stuff. */
     1349PVOID APIENTRY WinQueryProperty(HWND hwnd, PCSZ pszNameOrAtom);
     1350PVOID APIENTRY WinRemoveProperty(HWND hwnd, PCSZ pszNameOrAtom);
     1351BOOL  APIENTRY WinSetProperty(HWND hwnd, PCSZ pszNameOrAtom, PVOID pvData, ULONG ulFlags);
     1352
     1353/**
     1354 * Set Property.
     1355 * @returns Success indicator.
     1356 * @param   hwnd    Window the property is associated with.
     1357 * @param   psz     The property atom or name.
     1358 * @param   pv      Property value.
     1359 * @param   fFlags  Flags. Use 0.
     1360 */
     1361BOOL    OSLibSetProperty(HWND hwnd, const char *psz, void *pv, unsigned fFlags)
     1362{
     1363    USHORT selFS = RestoreOS2FS();
     1364    BOOL fRet = WinSetProperty(hwnd, psz, pv, fFlags);
     1365    SetFS(selFS);
     1366    return fRet;
     1367}
     1368
     1369/**
     1370 * Get Property.
     1371 * @returns Property value.
     1372 * @param   hwnd    Window the property is associated with.
     1373 * @param   psz     The property atom or name.
     1374 */
     1375void *  OSLibQueryProperty(HWND hwnd, const char *psz)
     1376{
     1377    USHORT selFS = RestoreOS2FS();
     1378    void *pvRet = WinQueryProperty(hwnd, psz);
     1379    SetFS(selFS);
     1380    return pvRet;
     1381}
     1382
     1383/**
     1384 * Remove Property.
     1385 * @returns Property value.
     1386 * @param   hwnd    Window the property is associated with.
     1387 * @param   psz     The property atom or name.
     1388 */
     1389void *  OSLibRemoveProperty(HWND hwnd, const char *psz)
     1390{
     1391    USHORT selFS = RestoreOS2FS();
     1392    void *pvRet = WinRemoveProperty(hwnd, psz);
     1393    SetFS(selFS);
     1394    return pvRet;
     1395}
     1396
Note: See TracChangeset for help on using the changeset viewer.