Changeset 3501 for trunk/src/user32


Ignore:
Timestamp:
May 9, 2000, 8:56:59 PM (25 years ago)
Author:
sandervl
Message:

lots of changes/fixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r3225 r3501  
    1 /* $Id: menu.cpp,v 1.20 2000-03-24 19:20:33 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.21 2000-05-09 18:56:56 sandervl Exp $*/
    22/*
    33 * Menu functions
     
    15991599            if (!pTopPopupWnd)
    16001600            {
     1601                DebugInt3();
    16011602                return FALSE;
    16021603            }
     
    16151616                if( !menu->hWnd )
    16161617                {
     1618                    DebugInt3();
    16171619                    return FALSE;
    16181620                }
     
    21832185   {
    21842186        Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(menu->hWnd);
    2185         if(win32wnd==NULL)
    2186                 DebugInt3();
     2187        if(win32wnd==NULL) {
     2188            //SvL: This happens in Moraff's YourJongg 2.0, return here
     2189            //TODO: Check if this is supposed to happen at all...
     2190            return (HMENU)0;
     2191        }
    21872192
    21882193        ht = win32wnd->HandleNCHitTest(pt);
  • trunk/src/user32/user32.cpp

    r3491 r3501  
    1 /* $Id: user32.cpp,v 1.80 2000-05-03 22:33:36 sandervl Exp $ */
     1/* $Id: user32.cpp,v 1.81 2000-05-09 18:56:57 sandervl Exp $ */
    22
    33/*
     
    122122BOOL WIN32API InflateRect( PRECT lprc, int dx, int  dy)
    123123{
    124     dprintf2(("USER32:  InflateRect\n"));
     124    dprintf2(("USER32: InflateRect (%d,%d)(%d,%d) %d,%d", lprc->left, lprc->top, lprc->right, lprc->bottom, dx, dy));
    125125    if (!lprc)
    126126    {
     
    140140BOOL WIN32API IntersectRect( PRECT lprcDst, const RECT * lprcSrc1, const RECT * lprcSrc2)
    141141{
    142     dprintf2(("USER32:  IntersectRect\n"));
     142    dprintf2(("USER32:  IntersectRect (%d,%d)(%d,%d) (%d,%d)(%d,%d)", lprcSrc1->left, lprcSrc1->top, lprcSrc1->right, lprcSrc1->bottom, lprcSrc2->left, lprcSrc2->top, lprcSrc2->right, lprcSrc2->bottom));
    143143    if (!lprcSrc1 || !lprcSrc2)
    144144    {
    145       SetLastError(ERROR_INVALID_PARAMETER);
    146       return FALSE;
     145        SetLastError(ERROR_INVALID_PARAMETER);
     146        return FALSE;
    147147    }
    148148
     
    182182BOOL WIN32API OffsetRect( PRECT lprc, int x, int  y)
    183183{
    184     dprintf2(("USER32:  OffsetRect\n"));
     184    dprintf2(("USER32: OffsetRect (%d,%d)(%d,%d) %d %d", lprc->left, lprc->top, lprc->right, lprc->bottom, x, y));
    185185    if (!lprc)
    186186    {
    187       SetLastError(ERROR_INVALID_PARAMETER);
    188       return FALSE;
     187        SetLastError(ERROR_INVALID_PARAMETER);
     188        return FALSE;
    189189    }
    190190
     
    200200BOOL WIN32API PtInRect( const RECT *lprc, POINT pt)
    201201{
    202     dprintf2(("USER32:  PtInRect\n"));
     202    dprintf2(("USER32: PtInRect (%d,%d)(%d,%d) (%d,%d)", lprc->left, lprc->top, lprc->right, lprc->bottom, pt.x, pt.y));
    203203    if (!lprc)
    204204    {
  • trunk/src/user32/win32wbase.cpp

    r3493 r3501  
    1 /* $Id: win32wbase.cpp,v 1.184 2000-05-05 11:32:36 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.185 2000-05-09 18:56:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    797797ULONG Win32BaseWindow::MsgShow(BOOL fShow)
    798798{
    799     if(fNoSizeMsg) {
     799    if(fNoSizeMsg || fDestroyWindowCalled) {
    800800        return 1;
    801801    }
     
    865865 ULONG rc, procidhwnd = -1, threadidhwnd = 0;
    866866
     867    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
     868    if(fDestroyWindowCalled) {
     869        return 0;
     870    }
    867871
    868872    //According to SDK docs, if app returns FALSE & window is being deactivated,
     
    910914ULONG Win32BaseWindow::MsgSetFocus(HWND hwnd)
    911915{
     916    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
     917    if(fDestroyWindowCalled) {
     918        return 0;
     919    }
     920
    912921    return  SendInternalMessageA(WM_SETFOCUS, hwnd, 0);
    913922}
     
    916925ULONG Win32BaseWindow::MsgKillFocus(HWND hwnd)
    917926{
     927    //SvL: Don't send WM_(NC)ACTIVATE messages when the window is being destroyed
     928    if(fDestroyWindowCalled) {
     929        return 0;
     930    }
    918931    return  SendInternalMessageA(WM_KILLFOCUS, hwnd, 0);
    919932}
     
    20242037{
    20252038 ULONG showstate = 0;
    2026  HWND hWinAfter;
     2039 HWND  hWinAfter;
     2040 BOOL  rc;
    20272041
    20282042    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
    20292043
    2030     if (flags & WIN_NEED_SIZE)
    2031     {
    2032         /* should happen only in CreateWindowEx() */
    2033         int wParam = SIZE_RESTORED;
    2034 
    2035         flags &= ~WIN_NEED_SIZE;
    2036         if (dwStyle & WS_MAXIMIZE)
    2037             wParam = SIZE_MAXIMIZED;
    2038         else
    2039         if (dwStyle & WS_MINIMIZE)
    2040             wParam = SIZE_MINIMIZED;
    2041 
    2042         SendInternalMessageA(WM_SIZE, wParam,
    2043                      MAKELONG(rectClient.right-rectClient.left,
    2044                               rectClient.bottom-rectClient.top));
    2045         SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
     2044    if(getWindowHandle() == 0x68000002) {
     2045//      DebugInt3();
    20462046    }
    20472047    switch(nCmdShow)
     
    20892089    else    setStyle(getStyle() & ~WS_VISIBLE);
    20902090
    2091     BOOL rc = OSLibWinShowWindow(OS2HwndFrame, showstate);
     2091    rc = OSLibWinShowWindow(OS2HwndFrame, showstate);
    20922092
    20932093    SendInternalMessageA(WM_SHOWWINDOW, (showstate & SWPOS_SHOW) ? 1 : 0, 0);
     2094
     2095    if (flags & WIN_NEED_SIZE)
     2096    {
     2097        /* should happen only in CreateWindowEx() */
     2098        int wParam = SIZE_RESTORED;
     2099
     2100        flags &= ~WIN_NEED_SIZE;
     2101        if (dwStyle & WS_MAXIMIZE)
     2102            wParam = SIZE_MAXIMIZED;
     2103        else
     2104        if (dwStyle & WS_MINIMIZE)
     2105            wParam = SIZE_MINIMIZED;
     2106
     2107        SendInternalMessageA(WM_SIZE, wParam,
     2108                     MAKELONG(rectClient.right-rectClient.left,
     2109                              rectClient.bottom-rectClient.top));
     2110        SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
     2111    }
    20942112
    20952113    return rc;
     
    22562274BOOL Win32BaseWindow::DestroyWindow()
    22572275{
     2276 HWND hwnd = getWindowHandle();
     2277
     2278    dprintf(("DestroyWindow %x", hwnd));
     2279
    22582280    /* Call hooks */
    22592281    if(HOOK_CallHooksA( WH_CBT, HCBT_DESTROYWND, getWindowHandle(), 0L))
     
    22742296             /* Notify the parent window only */
    22752297             getParent()->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_DESTROY, getWindowId()), (LPARAM)getWindowHandle());
    2276              if( !::IsWindow(getWindowHandle()) )
     2298             if(!::IsWindow(hwnd) )
    22772299             {
    22782300                return TRUE;
     
    22812303        else DebugInt3();
    22822304    }
     2305
     2306    /* Hide the window */
     2307    if(IsWindowVisible())
     2308    {
     2309        SetWindowPos(0, 0, 0, 0, 0, SWP_HIDEWINDOW |
     2310                     SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE);
     2311        if(!::IsWindow(hwnd))
     2312        {
     2313                return TRUE;
     2314        }
     2315    }
     2316    dprintf(("DestroyWindow %x -> HIDDEN", hwnd));
     2317
    22832318    fDestroyWindowCalled = TRUE;
    22842319    return OSLibWinDestroyWindow(OS2HwndFrame);
  • trunk/src/user32/window.cpp

    r3493 r3501  
    1 /* $Id: window.cpp,v 1.65 2000-05-05 11:32:38 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.66 2000-05-09 18:56:59 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    317317        return 0;
    318318    }
    319     dprintf(("DestroyWindow %x", hwnd));
    320319    return window->DestroyWindow();
    321320}
     
    812811    dprintf(("AdjustWindowRectEx %x %x %d (%d,%d)(%d,%d)\n", style, exStyle, menu, rect->left, rect->top, rect->right, rect->bottom));
    813812
     813    if(style == 0 && menu == FALSE && exStyle == 0) {
     814        return TRUE;    //nothing needs to be changed (VERIFIED in NT 4)
     815    }
    814816    /* Correct the window style */
    815817    if (!(style & (WS_POPUP | WS_CHILD)))  /* Overlapped window */
     
    10261028{
    10271029    dprintf(("FlashWindow %x %d\n", hwnd, fFlash));
    1028     return OSLibWinFlashWindow(Win32BaseWindow::Win32ToOS2Handle(hwnd), fFlash);
     1030//    return OSLibWinFlashWindow(Win32BaseWindow::Win32ToOS2Handle(hwnd), fFlash);
     1031    return 1;
    10291032}
    10301033//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.