Ignore:
Timestamp:
Jul 14, 1999, 11:05:59 PM (26 years ago)
Author:
cbratschi
Message:

several bugs fixed, RegisterClass works, CreateWindow on the way

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32wnd.cpp

    r300 r304  
    1 /* $Id: win32wnd.cpp,v 1.1 1999-07-14 08:35:37 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.2 1999-07-14 21:05:58 cbratschi Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    4545//******************************************************************************
    4646Win32Window::Win32Window(CREATESTRUCTA *lpCreateStructA, ATOM classAtom, BOOL isUnicode)
    47                         : GenericObject(&windows, OBJTYPE_WINDOW)
     47                        : GenericObject(&windows, OBJTYPE_WINDOW)
    4848{
    4949  Init();
     
    5757  isUnicode        = FALSE;
    5858
    59   *windowName      = NULL;
     59  windowName       = NULL;
    6060  wndNameLength    = 0;
    6161
    62   *windowText      = NULL;;
     62  windowText       = NULL;;
    6363  wndTextLength    = 0;
    64        
    65   *userWindowLong  = NULL;;
     64
     65  userWindowLong   = NULL;;
    6666  nrUserWindowLong = 0;
    6767
     
    6969  OS2Hwnd          = 0;
    7070  Win32Hwnd        = 0;
    71   if(HMHandleAllocate(&Win32Hwnd, (ULONG)this) != 0)
    72   {
    73         dprintf(("Win32Window::Init HMHandleAllocate failed!!"));
    74         DebugInt3();
     71
     72  //CB: what does this code? Win32Hwnd is always 0!
     73  if(HMHandleAllocate(&Win32Hwnd, (ULONG)this) != 0)
     74  {
     75        dprintf(("Win32Window::Init HMHandleAllocate failed!!"));
     76        DebugInt3();
    7577  }
    7678  posx = posy      = 0;
     
    7880
    7981  dwExStyle        = 0;
    80   dwStyle          = 0;
     82  dwStyle          = 0;
    8183  win32wndproc     = 0;
    8284  hInstance        = 0;
    8385  parent           = 0;
    84   windowId         = 0xFFFFFFFF;        //default = -1
     86  windowId         = 0xFFFFFFFF;        //default = -1
    8587  userData         = 0;
    8688
     
    9597{
    9698  if(Win32Hwnd)
    97         HMHandleFree(Win32Hwnd);
     99        HMHandleFree(Win32Hwnd);
    98100  if(windowName)
    99         free(windowName);
     101        free(windowName);
    100102  if(windowText)
    101         free(windowText);
     103        free(windowText);
    102104  if(userWindowLong)
    103         free(userWindowLong);
     105        free(userWindowLong);
    104106}
    105107//******************************************************************************
     
    109111 char  buffer[256];
    110112 DWORD tmp;
    111  INT   sw = SW_SHOW; 
     113 INT   sw = SW_SHOW;
    112114 POINT maxSize, maxPos, minTrack, maxTrack;
    113115
     
    117119  if (cs->hwndParent)
    118120  {
    119         /* Make sure parent is valid */
     121        /* Make sure parent is valid */
    120122        if (!IsWindow( cs->hwndParent ))
    121123        {
    122                 dprintf(("Bad parent %04x\n", cs->hwndParent ));
    123                 SetLastError(ERROR_INVALID_PARAMETER);
    124                 return FALSE;
    125         }
    126   } 
    127   else 
     124                dprintf(("Bad parent %04x\n", cs->hwndParent ));
     125                SetLastError(ERROR_INVALID_PARAMETER);
     126                return FALSE;
     127        }
     128  }
     129  else
    128130  if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) {
    129131        dprintf(("No parent for child window\n" ));
    130         SetLastError(ERROR_INVALID_PARAMETER);
     132        SetLastError(ERROR_INVALID_PARAMETER);
    131133        return FALSE;  /* WS_CHILD needs a parent, but WS_POPUP doesn't */
    132134  }
     
    141143  }
    142144
    143   /* Fix the lpszClass field: from existing programs, it seems ok to call a CreateWindowXXX 
    144    * with an atom as the class name, put some programs expect to have a *REAL* string in 
    145    * lpszClass when the CREATESTRUCT is sent with WM_CREATE 
     145  /* Fix the lpszClass field: from existing programs, it seems ok to call a CreateWindowXXX
     146   * with an atom as the class name, put some programs expect to have a *REAL* string in
     147   * lpszClass when the CREATESTRUCT is sent with WM_CREATE
    146148   */
    147   if (!HIWORD(cs->lpszClass) ) {       
     149  if (!HIWORD(cs->lpszClass) ) {
    148150        if (isUnicode) {
    149                 GlobalGetAtomNameW( classAtom, (LPWSTR)buffer, sizeof(buffer) );
    150         }
    151         else {
    152                 GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
    153         }
    154         cs->lpszClass = buffer;
     151                GlobalGetAtomNameW( classAtom, (LPWSTR)buffer, sizeof(buffer) );
     152        }
     153        else {
     154                GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
     155        }
     156        cs->lpszClass = buffer;
    155157  }
    156158
     
    160162//        PDB *pdb = PROCESS_Current();
    161163
    162        /* Never believe Microsoft's documentation... CreateWindowEx doc says 
    163         * that if an overlapped window is created with WS_VISIBLE style bit 
     164       /* Never believe Microsoft's documentation... CreateWindowEx doc says
     165        * that if an overlapped window is created with WS_VISIBLE style bit
    164166        * set and the x parameter is set to CW_USEDEFAULT, the system ignores
    165167        * the y parameter. However, disassembling NT implementation (WIN32K.SYS)
    166168        * reveals that
    167169        *
    168         * 1) not only if checks for CW_USEDEFAULT but also for CW_USEDEFAULT16 
    169         * 2) it does not ignore the y parameter as the docs claim; instead, it 
     170        * 1) not only if checks for CW_USEDEFAULT but also for CW_USEDEFAULT16
     171        * 2) it does not ignore the y parameter as the docs claim; instead, it
    170172        *    uses it as second parameter to ShowWindow() unless y is either
    171173        *    CW_USEDEFAULT or CW_USEDEFAULT16.
    172         * 
     174        *
    173175        * The fact that we didn't do 2) caused bogus windows pop up when wine
    174         * was running apps that were using this obscure feature. Example - 
    175         * calc.exe that comes with Win98 (only Win98, it's different from 
     176        * was running apps that were using this obscure feature. Example -
     177        * calc.exe that comes with Win98 (only Win98, it's different from
    176178        * the one that comes with Win95 and NT)
    177179        */
     
    212214  nrUserWindowLong = windowClass->getExtraWndWords();
    213215  if(nrUserWindowLong) {
    214         userWindowLong = (ULONG *)malloc(nrUserWindowLong);
    215         memset(userWindowLong, 0, nrUserWindowLong);
     216        userWindowLong = (ULONG *)malloc(nrUserWindowLong);
     217        memset(userWindowLong, 0, nrUserWindowLong);
    216218  }
    217219
    218220  if ((cs->style & WS_CHILD) && cs->hwndParent)
    219221  {
    220         if(HMHandleTranslateToOS2(cs->hwndParent, &tmp) != NO_ERROR)
    221         {
    222                 dprintf(("HMHandleTranslateToOS2 couldn't find parent window %x!!!", cs->hwndParent));
    223                 return FALSE;
    224         }
    225         parent = (Win32Window *)tmp;
     222        if(HMHandleTranslateToOS2(cs->hwndParent, &tmp) != NO_ERROR)
     223        {
     224                dprintf(("HMHandleTranslateToOS2 couldn't find parent window %x!!!", cs->hwndParent));
     225                return FALSE;
     226        }
     227        parent = (Win32Window *)tmp;
    226228  }
    227229  else
    228230  {
    229         parent = NULL;  //desktop
     231        parent = NULL;  //desktop
    230232        if (!cs->hwndParent) {
    231                 owner = NULL;
    232         }
     233                owner = NULL;
     234        }
    233235        else
    234236        {
    235                 if(HMHandleTranslateToOS2(cs->hwndParent, &tmp) != NO_ERROR)
    236                 {
    237                         dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
    238                         return FALSE;
    239                 }
    240                 owner = (Win32Window *)tmp;
    241         }
     237                if(HMHandleTranslateToOS2(cs->hwndParent, &tmp) != NO_ERROR)
     238                {
     239                        dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent));
     240                        return FALSE;
     241                }
     242                owner = (Win32Window *)tmp;
     243        }
    242244  }
    243245
     
    256258  if (!(cs->style & WS_CHILD))
    257259  {
    258         dwStyle |= WS_CLIPSIBLINGS;
    259         if (!(cs->style & WS_POPUP))
    260         {
     260        dwStyle |= WS_CLIPSIBLINGS;
     261        if (!(cs->style & WS_POPUP))
     262        {
    261263            dwStyle |= WS_CAPTION;
    262264            flags |= WIN_NEED_SIZE;
    263         }
     265        }
    264266  }
    265267  if (cs->dwExStyle & WS_EX_DLGMODALFRAME) dwStyle &= ~WS_THICKFRAME;
     
    300302        else
    301303        {
    302                 if (windowClass->getMenuNameA()) {
    303                         cs->hMenu = LoadMenuA(cs->hInstance, windowClass->getMenuNameA());
    304                         if (cs->hMenu) SetMenu( getWindowHandle(), cs->hMenu );
    305                 }
    306         }
    307   }
    308   else  windowId = (UINT)cs->hMenu;
     304                if (windowClass->getMenuNameA()) {
     305                        cs->hMenu = LoadMenuA(cs->hInstance, windowClass->getMenuNameA());
     306                        if (cs->hMenu) SetMenu( getWindowHandle(), cs->hMenu );
     307                }
     308        }
     309  }
     310  else  windowId = (UINT)cs->hMenu;
    309311
    310312  DWORD dwOSWinStyle, dwOSFrameStyle;
     
    314316  OS2Hwnd = OSLibWinCreateWindow((parent) ? parent->getOS2WindowHandle() : 0,
    315317                                 dwOSWinStyle, dwOSFrameStyle, (char *)cs->lpszName,
    316                                  cs->x, cs->y, cs->cx, cs->cy, 
    317                                  (owner) ? owner->getOS2WindowHandle() : 0,
     318                                 cs->x, cs->y, cs->cx, cs->cy,
     319                                 (owner) ? owner->getOS2WindowHandle() : 0,
    318320                                 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE);
    319321
    320322  if(OS2Hwnd == 0) {
    321         dprintf(("Window creation failed!!"));
    322         return FALSE;
     323        dprintf(("Window creation failed!!"));
     324        return FALSE;
    323325  }
    324326  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, (ULONG)this) == FALSE) {
    325         dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
    326         return FALSE;
     327        dprintf(("WM_CREATE: WinSetWindowULong %X failed!!", OS2Hwnd));
     328        return FALSE;
    327329  }
    328330  if(OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32PM_MAGIC, WIN32PM_MAGIC) == FALSE) {
    329         dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
    330         return FALSE;
    331   }
    332 
     331        dprintf(("WM_CREATE: WinSetWindowULong2 %X failed!!", OS2Hwnd));
     332        return FALSE;
     333  }
     334
     335  return TRUE;
    333336}
    334337/*******************************************************************
     
    338341 */
    339342void Win32Window::GetMinMaxInfo(POINT *maxSize, POINT *maxPos,
    340                                 POINT *minTrack, POINT *maxTrack )
     343                                POINT *minTrack, POINT *maxTrack )
    341344{
    342345    MINMAXINFO MinMax;
     
    378381    lpPos = (LPINTERNALPOS)GetPropA( wndPtr->hwndSelf, atomInternalPos );
    379382    if( lpPos && !EMPTYPOINT(lpPos->ptMaxPos) )
    380         CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
     383        CONV_POINT16TO32( &lpPos->ptMaxPos, &MinMax.ptMaxPosition );
    381384    else
    382385    {
     
    454457{
    455458 WORD fwSizeType = 0;
    456  
     459
    457460  if(fMinimize) {
    458         fwSizeType = SIZE_MINIMIZED;
     461        fwSizeType = SIZE_MINIMIZED;
    459462  }
    460463  else
    461464  if(fMaximize) {
    462         fwSizeType = SIZE_MAXIMIZED;
    463   }
    464   else  fwSizeType = SIZE_RESTORED;
     465        fwSizeType = SIZE_MAXIMIZED;
     466  }
     467  else  fwSizeType = SIZE_RESTORED;
    465468
    466469  return SendMessageA(WM_SIZE, fwSizeType, MAKELONG((USHORT)width, (USHORT)height));
     
    491494
    492495  switch(msg) {
    493         case BUTTON_LEFTDOWN:
    494                 win32msg = WM_LBUTTONDOWN;
    495                 break;
    496         case BUTTON_LEFTUP:
    497                 win32msg = WM_LBUTTONUP;
    498                 break;
    499         case BUTTON_LEFTDBLCLICK:
    500                 win32msg = WM_LBUTTONDBLCLK;
    501                 break;
    502         case BUTTON_RIGHTUP:
    503                 win32msg = WM_RBUTTONUP;
    504                 break;
    505         case BUTTON_RIGHTDOWN:
    506                 win32msg = WM_RBUTTONDOWN;
    507                 break;
    508         case BUTTON_RIGHTDBLCLICK:
    509                 win32msg = WM_RBUTTONDBLCLK;
    510                 break;
    511         default:
    512                 dprintf(("Win32Window::Button: invalid msg!!!!"));
    513                 return 1;
     496        case BUTTON_LEFTDOWN:
     497                win32msg = WM_LBUTTONDOWN;
     498                break;
     499        case BUTTON_LEFTUP:
     500                win32msg = WM_LBUTTONUP;
     501                break;
     502        case BUTTON_LEFTDBLCLICK:
     503                win32msg = WM_LBUTTONDBLCLK;
     504                break;
     505        case BUTTON_RIGHTUP:
     506                win32msg = WM_RBUTTONUP;
     507                break;
     508        case BUTTON_RIGHTDOWN:
     509                win32msg = WM_RBUTTONDOWN;
     510                break;
     511        case BUTTON_RIGHTDBLCLICK:
     512                win32msg = WM_RBUTTONDBLCLK;
     513                break;
     514        default:
     515                dprintf(("Win32Window::Button: invalid msg!!!!"));
     516                return 1;
    514517  }
    515518  return SendMessageA(win32msg, 0, MAKELONG(x, OS2TOWIN32POINT(height, y)));
     
    532535{
    533536  if(PostSpyMessage(getWindowHandle(), Msg, wParam, lParam) == FALSE)
    534         dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
     537        dprintf(("SendMessageA %s for %x %x %x", GetMsgText(Msg), getWindowHandle(), wParam, lParam));
    535538
    536539  if(HkCBT::OS2HkCBTProc(getWindowHandle(), Msg, wParam, lParam) == TRUE) {//hook swallowed msg
     
    539542  switch(Msg)
    540543  {
    541         case WM_CREATE:
    542         {
     544        case WM_CREATE:
     545        {
    543546                if(win32wndproc(getWindowHandle(), WM_NCCREATE, 0, lParam) == 0) {
    544                         dprintf(("WM_NCCREATE returned FALSE\n"));
    545                         return(0); //don't create window
     547                        dprintf(("WM_NCCREATE returned FALSE\n"));
     548                        return(0); //don't create window
    546549                }
    547550                if(win32wndproc(getWindowHandle(), WM_CREATE, 0, lParam) == 0) {
    548                         dprintf(("WM_CREATE returned FALSE\n"));
    549                         return(0); //don't create window
    550                 }
    551                 NotifyParent(Msg, wParam, lParam);
    552 
    553                 return(1);
    554         }
    555         case WM_LBUTTONDOWN:
    556         case WM_MBUTTONDOWN:
    557         case WM_RBUTTONDOWN:
    558                 NotifyParent(Msg, wParam, lParam);
    559                 return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
    560 
    561         case WM_DESTROY:
    562                 win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
    563                 NotifyParent(Msg, wParam, lParam);
    564                 return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
    565         default:
    566                 return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     551                        dprintf(("WM_CREATE returned FALSE\n"));
     552                        return(0); //don't create window
     553                }
     554                NotifyParent(Msg, wParam, lParam);
     555
     556                return(1);
     557        }
     558        case WM_LBUTTONDOWN:
     559        case WM_MBUTTONDOWN:
     560        case WM_RBUTTONDOWN:
     561                NotifyParent(Msg, wParam, lParam);
     562                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
     563
     564        case WM_DESTROY:
     565                win32wndproc(getWindowHandle(), WM_NCDESTROY, 0, 0);
     566                NotifyParent(Msg, wParam, lParam);
     567                return win32wndproc(getWindowHandle(), WM_DESTROY, 0, 0);
     568        default:
     569                return win32wndproc(getWindowHandle(), Msg, wParam, lParam);
    567570  }
    568571}
     
    574577 Win32Window *parentwindow;
    575578
    576    while(window) 
     579   while(window)
    577580   {
    578         if(window->getStyle() & WS_CHILD && !(window->getExStyle() & WS_EX_NOPARENTNOTIFY) )
    579         {
    580                 /* Notify the parent window only */
    581                 parentwindow = window->getParent();
    582                 if(parentwindow) {
    583                         if(Msg == WM_CREATE || Msg == WM_DESTROY) {
    584                                 parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
    585                         }
    586                         else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
    587                 }
    588         }
    589         else    break;
    590 
    591         window = parentwindow;
     581        if(window->getStyle() & WS_CHILD && !(window->getExStyle() & WS_EX_NOPARENTNOTIFY) )
     582        {
     583                /* Notify the parent window only */
     584                parentwindow = window->getParent();
     585                if(parentwindow) {
     586                        if(Msg == WM_CREATE || Msg == WM_DESTROY) {
     587                                parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), (LPARAM)window->getWindowHandle());
     588                        }
     589                        else    parentwindow->SendMessageA(WM_PARENTNOTIFY, MAKEWPARAM(Msg, window->getWindowId()), lParam );
     590                }
     591        }
     592        else    break;
     593
     594        window = parentwindow;
    592595   }
    593596}
     
    599602
    600603   switch(index) {
    601         case GWL_EXSTYLE:
    602                 oldval = dwExStyle;
    603                 dwExStyle = value;
    604                 return oldval;
    605         case GWL_STYLE:
    606                 oldval = dwStyle;
    607                 dwStyle = value;
    608                 return oldval;
    609         case GWL_WNDPROC:
    610                 oldval = (LONG)getWindowProc();
    611                 setWindowProc((WNDPROC)value);
    612                 return oldval;
    613         case GWL_HINSTANCE:
    614                 oldval = hInstance;
    615                 hInstance = value;
    616                 return oldval;
    617         case GWL_HWNDPARENT:
    618         {
    619          ULONG tmp;
    620 
    621                 if(getParent()) {
    622                         oldval = getParent()->getWindowHandle();
    623                 }
    624                 else    oldval = 0;
    625 
    626                 if(value == 0) {//desktop window = parent
    627                         setParent(NULL);
    628                         OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP);
    629                         return oldval;
    630                 }
    631                 if(HMHandleTranslateToOS2(value, &tmp) == NO_ERROR)
    632                 {
    633                         setParent((Win32Window *)tmp);
    634                         OSLibWinSetParent(getOS2WindowHandle(), getParent()->getOS2WindowHandle());
    635                         return oldval;
    636                 }
    637                 SetLastError(ERROR_INVALID_PARAMETER);
    638                 return 0;
    639         }
    640         case GWL_ID:
    641                 oldval = getWindowId();
    642                 setWindowId(value);
    643                 return oldval;
    644         case GWL_USERDATA:
    645                 oldval = userData;
    646                 userData = value;
    647                 return oldval;
    648         default:
    649                 if(index >= 0 && index/4 < nrUserWindowLong)
    650                 {
    651                         oldval = userWindowLong[index/4];
    652                         userWindowLong[index/4] = value;
    653                         return oldval;
    654                 }
    655                 SetLastError(ERROR_INVALID_PARAMETER);
    656                 return 0;
     604        case GWL_EXSTYLE:
     605                oldval = dwExStyle;
     606                dwExStyle = value;
     607                return oldval;
     608        case GWL_STYLE:
     609                oldval = dwStyle;
     610                dwStyle = value;
     611                return oldval;
     612        case GWL_WNDPROC:
     613                oldval = (LONG)getWindowProc();
     614                setWindowProc((WNDPROC)value);
     615                return oldval;
     616        case GWL_HINSTANCE:
     617                oldval = hInstance;
     618                hInstance = value;
     619                return oldval;
     620        case GWL_HWNDPARENT:
     621        {
     622         ULONG tmp;
     623
     624                if(getParent()) {
     625                        oldval = getParent()->getWindowHandle();
     626                }
     627                else    oldval = 0;
     628
     629                if(value == 0) {//desktop window = parent
     630                        setParent(NULL);
     631                        OSLibWinSetParent(getOS2WindowHandle(), OSLIB_HWND_DESKTOP);
     632                        return oldval;
     633                }
     634                if(HMHandleTranslateToOS2(value, &tmp) == NO_ERROR)
     635                {
     636                        setParent((Win32Window *)tmp);
     637                        OSLibWinSetParent(getOS2WindowHandle(), getParent()->getOS2WindowHandle());
     638                        return oldval;
     639                }
     640                SetLastError(ERROR_INVALID_PARAMETER);
     641                return 0;
     642        }
     643        case GWL_ID:
     644                oldval = getWindowId();
     645                setWindowId(value);
     646                return oldval;
     647        case GWL_USERDATA:
     648                oldval = userData;
     649                userData = value;
     650                return oldval;
     651        default:
     652                if(index >= 0 && index/4 < nrUserWindowLong)
     653                {
     654                        oldval = userWindowLong[index/4];
     655                        userWindowLong[index/4] = value;
     656                        return oldval;
     657                }
     658                SetLastError(ERROR_INVALID_PARAMETER);
     659                return 0;
    657660   }
    658661}
     
    662665{
    663666   switch(index) {
    664         case GWL_EXSTYLE:
    665                 return dwExStyle;
    666         case GWL_STYLE:
    667                 return dwStyle;
    668         case GWL_WNDPROC:
    669                 return (ULONG)getWindowProc();
    670         case GWL_HINSTANCE:
    671                 return hInstance;
    672         case GWL_HWNDPARENT:
    673                 if(getParent()) {
    674                         return getParent()->getWindowHandle();
    675                 }
    676                 else    return 0;
    677         case GWL_ID:
    678                 return getWindowId();
    679         case GWL_USERDATA:
    680                 return userData;
    681         default:
    682                 if(index >= 0 && index/4 < nrUserWindowLong)
    683                 {
    684                         return userWindowLong[index/4];
    685                 }
    686                 SetLastError(ERROR_INVALID_PARAMETER);
    687                 return 0;
     667        case GWL_EXSTYLE:
     668                return dwExStyle;
     669        case GWL_STYLE:
     670                return dwStyle;
     671        case GWL_WNDPROC:
     672                return (ULONG)getWindowProc();
     673        case GWL_HINSTANCE:
     674                return hInstance;
     675        case GWL_HWNDPARENT:
     676                if(getParent()) {
     677                        return getParent()->getWindowHandle();
     678                }
     679                else    return 0;
     680        case GWL_ID:
     681                return getWindowId();
     682        case GWL_USERDATA:
     683                return userData;
     684        default:
     685                if(index >= 0 && index/4 < nrUserWindowLong)
     686                {
     687                        return userWindowLong[index/4];
     688                }
     689                SetLastError(ERROR_INVALID_PARAMETER);
     690                return 0;
    688691   }
    689692}
     
    696699   if(index >= 0 && index/4 < nrUserWindowLong)
    697700   {
    698         oldval = ((WORD *)userWindowLong)[index/2];
    699         ((WORD *)userWindowLong)[index/2] = value;
    700         return oldval;
     701        oldval = ((WORD *)userWindowLong)[index/2];
     702        ((WORD *)userWindowLong)[index/2] = value;
     703        return oldval;
    701704   }
    702705   SetLastError(ERROR_INVALID_PARAMETER);
     
    709712   if(index >= 0 && index/4 < nrUserWindowLong)
    710713   {
    711         return ((WORD *)userWindowLong)[index/2];
     714        return ((WORD *)userWindowLong)[index/2];
    712715   }
    713716   SetLastError(ERROR_INVALID_PARAMETER);
Note: See TracChangeset for help on using the changeset viewer.