Ignore:
Timestamp:
Feb 18, 2001, 6:59:05 PM (25 years ago)
Author:
sandervl
Message:

DestroyWindow during CreateWindow fix

File:
1 edited

Legend:

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

    r5164 r5173  
    1 /* $Id: win32wbase.cpp,v 1.236 2001-02-18 14:18:39 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.237 2001-02-18 17:59:05 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    9797  fComingToTop     = FALSE;
    9898  fCreateSetWindowPos = FALSE;
     99  fCreationFinished= FALSE;
    99100
    100101  windowNameA      = NULL;
     
    470471    }
    471472    OSLibWinSetVisibleRegionNotify(OS2Hwnd, TRUE);
     473    fCreationFinished = TRUE;   //creation done with success
    472474    SetLastError(0);
    473475    return TRUE;
     
    477479BOOL Win32BaseWindow::MsgCreate(HWND hwndOS2)
    478480{
    479  CREATESTRUCTA  *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
    480  POINT maxSize, maxPos, minTrack, maxTrack;
     481 CREATESTRUCTA *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
     482 POINT          maxSize, maxPos, minTrack, maxTrack;
     483 HWND           hwnd = getWindowHandle();
    481484
    482485    OS2Hwnd      = hwndOS2;
     
    707710                                         rectClient.bottom-rectClient.top));
    708711
     712                if(!::IsWindow(hwnd))
     713                {
     714                    dprintf(("Createwindow: WM_SIZE destroyed window"));
     715                    goto end;
     716                }
    709717                SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top));
     718                if(!::IsWindow(hwnd))
     719                {
     720                    dprintf(("Createwindow: WM_MOVE destroyed window"));
     721                    goto end;
     722                }
    710723            }
    711724            if (getStyle() & (WS_MINIMIZE | WS_MAXIMIZE))
    712725            {
    713                         RECT newPos;
    714                         UINT swFlag = (getStyle() & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
     726                RECT newPos;
     727                UINT swFlag = (getStyle() & WS_MINIMIZE) ? SW_MINIMIZE : SW_MAXIMIZE;
    715728                setStyle(getStyle() & ~(WS_MAXIMIZE | WS_MINIMIZE));
    716                         MinMaximize(swFlag, &newPos);
     729                MinMaximize(swFlag, &newPos);
    717730                swFlag = ((getStyle() & WS_CHILD) || GetActiveWindow()) ? SWP_NOACTIVATE | SWP_NOZORDER | SWP_FRAMECHANGED
    718731                                                                        : SWP_NOZORDER | SWP_FRAMECHANGED;
    719732                SetWindowPos(0, newPos.left, newPos.top,  newPos.right, newPos.bottom, swFlag);
     733                if(!::IsWindow(hwnd))
     734                {
     735                    dprintf(("Createwindow: min/max destroyed window"));
     736                    goto end;
     737                }
    720738            }
    721739
     
    727745                    getParent()->SendInternalMessageA(WM_PARENTNOTIFY, MAKEWPARAM(WM_CREATE, getWindowId()), (LPARAM)getWindowHandle());
    728746                }
    729                 if(!::IsWindow(getWindowHandle()))
     747                if(!::IsWindow(hwnd))
    730748                {
    731749                    dprintf(("Createwindow: WM_PARENTNOTIFY destroyed window"));
     
    796814    TIMER_KillTimerFromWindow(OS2Hwnd);
    797815
    798     if(getFirstChild() == NULL) {
     816    if(getFirstChild() == NULL && fCreationFinished) {
    799817        delete this;
    800818    }
Note: See TracChangeset for help on using the changeset viewer.