Changeset 5173 for trunk/src


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

DestroyWindow during CreateWindow fix

Location:
trunk/src/user32
Files:
4 edited

Legend:

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

    r5171 r5173  
    1 /* $Id: dc.cpp,v 1.87 2001-02-18 17:03:47 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.88 2001-02-18 17:59:04 sandervl Exp $ */
    22
    33/*
     
    471471//testestest
    472472   GpiQueryViewingLimits(pHps->hps, &rectWindowOS2);
    473    dprintf(("view limits (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
     473   dprintf2(("view limits (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
    474474   GpiQueryDefViewingLimits(pHps->hps, &rectWindowOS2);
    475    dprintf(("def view limits (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
     475   dprintf2(("def view limits (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
    476476   GpiQueryPageViewport(pHps->hps, &rectWindowOS2);
    477    dprintf(("page viewport (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
     477   dprintf2(("page viewport (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
    478478
    479479   GpiQueryGraphicsField(pHps->hps, &rectWindowOS2);
    480    dprintf(("graphics field (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
     480   dprintf2(("graphics field (%d,%d)(%d,%d)", rectWindowOS2.xLeft, rectWindowOS2.yBottom, rectWindowOS2.xRight, rectWindowOS2.yTop));
    481481
    482482   SIZEL size;
    483483   GpiQueryPickApertureSize(pHps->hps, &size);
    484    dprintf(("page viewport (%d,%d)", size.cx, size.cy));
     484   dprintf2(("page viewport (%d,%d)", size.cx, size.cy));
    485485//testestest
    486486
  • trunk/src/user32/win32dlg.cpp

    r5072 r5173  
    1 /* $Id: win32dlg.cpp,v 1.56 2001-02-08 18:17:16 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.57 2001-02-18 17:59:05 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    216216ULONG Win32Dialog::MsgCreate(HWND hwndOS2)
    217217{
    218  CREATESTRUCTA  *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
    219  LPARAM       param = tmpParam;
    220  LPSTR  dlgTemplate = tmpDlgTemplate;
    221 
    222     Win32BaseWindow::MsgCreate(hwndOS2);
     218 CREATESTRUCTA *cs = tmpcs;  //pointer to CREATESTRUCT used in CreateWindowExA method
     219 LPARAM         param = tmpParam;
     220 LPSTR          dlgTemplate = tmpDlgTemplate;
     221
     222    if(Win32BaseWindow::MsgCreate(hwndOS2) == FALSE) {
     223        dprintf(("********* DIALOG CREATION FAILED! (main dialog window) ************"));
     224        return FALSE;
     225    }
    223226
    224227    if(!isUnicode) {
  • 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    }
  • trunk/src/user32/win32wbase.h

    r5146 r5173  
    1 /* $Id: win32wbase.h,v 1.105 2001-02-17 14:49:26 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.106 2001-02-18 17:59:05 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    358358        BOOL    fDestroyWindowCalled;   //DestroyWindow was called for this window
    359359        BOOL    fCreated;
     360        BOOL    fCreationFinished;      //True when window or dialog has been created successfully
     361                                        //Needed to prevent DestroyWindow from deleting the window
     362                                        //object during construction
    360363        BOOL    fTaskList;              //should be listed in PM tasklist or not
    361364        BOOL    fXDefault;
Note: See TracChangeset for help on using the changeset viewer.