Changeset 5429 for trunk/src


Ignore:
Timestamp:
Apr 2, 2001, 12:13:28 AM (24 years ago)
Author:
sandervl
Message:

create dialog controls with CreateWindowExW; use correct SendMessage during CreateWindow

Location:
trunk/src/user32
Files:
3 edited

Legend:

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

    r5373 r5429  
    1 /* $Id: win32dlg.cpp,v 1.58 2001-03-25 08:50:42 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.59 2001-04-01 22:13:27 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    663663        dprintf(("Create CONTROL %d", info.id));
    664664
    665         char *classNameA = NULL;
    666         char *windowNameA = NULL;
    667 
    668         if(HIWORD(info.className)) {
    669              classNameA = UnicodeToAsciiString((LPWSTR)info.className);
    670         }
    671         else classNameA = (char *)info.className;
    672 
    673         if(HIWORD(info.windowName)) {
    674              windowNameA = UnicodeToAsciiString((LPWSTR)info.windowName);
    675         }
    676         else windowNameA = (char *)info.windowName;
    677 
    678         hwndCtrl = ::CreateWindowExA( info.exStyle | WS_EX_NOPARENTNOTIFY,
    679                                       classNameA,
    680                                       windowNameA,
     665        hwndCtrl = ::CreateWindowExW( info.exStyle | WS_EX_NOPARENTNOTIFY,
     666                                      (LPWSTR)info.className,
     667                                      (LPWSTR)info.windowName,
    681668                                      info.style | WS_CHILD,
    682669                                      MulDiv(info.x, xUnit, 4),
     
    686673                                      getWindowHandle(), (HMENU)info.id,
    687674                                      hInst, info.data );
    688         if(HIWORD(classNameA)) {
    689             FreeAsciiString(classNameA);
    690         }
    691         if(HIWORD(windowNameA)) {
    692             FreeAsciiString(windowNameA);
    693         }
    694675
    695676        if (!hwndCtrl) return FALSE;
  • trunk/src/user32/win32wbase.cpp

    r5404 r5429  
    1 /* $Id: win32wbase.cpp,v 1.247 2001-03-30 11:14:36 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.248 2001-04-01 22:13:27 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    300300    else
    301301    if ((cs->style & WS_CHILD) && !(cs->style & WS_POPUP)) {
    302             dprintf(("No parent for child window\n" ));
     302            dprintf(("No parent for child window" ));
    303303            SetLastError(ERROR_INVALID_PARAMETER);
    304304            return FALSE;  /* WS_CHILD needs a parent, but WS_POPUP doesn't */
     
    310310    {
    311311        GlobalGetAtomNameA( classAtom, buffer, sizeof(buffer) );
    312         dprintf(("Bad class '%s'\n", buffer ));
     312        dprintf(("Bad class '%s'", buffer ));
    313313        SetLastError(ERROR_INVALID_PARAMETER);
    314314        return 0;
     
    320320    if(HIWORD(cs->lpszClass))
    321321    {
    322         char *astring;
    323 
    324         if(isUnicode) astring = UnicodeToAsciiString((LPWSTR)cs->lpszClass);
    325         else          astring = (char *)cs->lpszClass;
    326 
    327         dprintf(("Window class %s", astring));
    328         if(isUnicode) FreeAsciiString(astring);
     322         if(isUnicode) dprintf(("Window class %ls", cs->lpszClass));
     323         else          dprintf(("Window class %s", cs->lpszClass));
    329324    }
    330325    else dprintf(("Window class %x", cs->lpszClass));
     
    490485 POINT          maxSize, maxPos, minTrack, maxTrack;
    491486 HWND           hwnd = getWindowHandle();
     487 LRESULT (* CALLBACK localSend32)(HWND, UINT, WPARAM, LPARAM);
    492488
    493489    OS2Hwnd      = hwndOS2;
     
    685681    }
    686682
    687     //cs is ascii version of create structure. so use SendInternalMessageA
    688     if(SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
     683    localSend32 = (isUnicode) ? ::SendMessageW : ::SendMessageA;
     684
     685    if(localSend32(getWindowHandle(), WM_NCCREATE,0,(LPARAM)cs))
    689686    {
    690687        RECT tmpRect;
     
    710707        fNoSizeMsg = FALSE;
    711708        if (cs->style & WS_VISIBLE) dwStyle |= WS_VISIBLE; //program could change position in WM_CREATE
    712         if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
     709        if( (localSend32(getWindowHandle(), WM_CREATE, 0, (LPARAM)cs )) != -1 )
    713710        {
    714711            if(!(flags & WIN_NEED_SIZE))
  • trunk/src/user32/windowclass.cpp

    r5428 r5429  
    1 /* $Id: windowclass.cpp,v 1.18 2001-04-01 19:38:51 sandervl Exp $ */
     1/* $Id: windowclass.cpp,v 1.19 2001-04-01 22:13:28 sandervl Exp $ */
    22/*
    33 * Win32 Window Class Code for OS/2
     
    4646 Win32WndClass *wclass;
    4747
    48     dprintf(("RegisterClassA\n"));
    4948    //CB: size new in ex structure
    5049    wc.cbSize = sizeof(wc);
     
    6261
    6362    //TODO: not destroyed when class is unregistered (neither does Wine, but that might be a bug)
     63    dprintf(("RegisterClassA"));
    6464    int iSmIconWidth  = GetSystemMetrics(SM_CXSMICON);
    6565    int iSmIconHeight = GetSystemMetrics(SM_CYSMICON);
     
    9292    }
    9393
    94     dprintf(("RegisterClassExA\n"));
     94    dprintf(("RegisterClassExA"));
    9595    wclass = new Win32WndClass((WNDCLASSEXA *)lpWndClass,FALSE);
    9696    if(wclass == NULL) {
     
    130130                           LR_COPYFROMRESOURCE);
    131131
     132    dprintf(("RegisterClassW"));
    132133    winclass = new Win32WndClass((WNDCLASSEXA *)&wc, TRUE);
    133134    if(winclass == NULL) {
     
    149150 Win32WndClass *winclass;
    150151
    151     dprintf(("RegisterClassExW\n"));
    152152    memcpy(&wc, lpwc, sizeof(WNDCLASSEXA));
    153153
     
    161161    }
    162162
     163    dprintf(("RegisterClassExW"));
    163164    winclass = new Win32WndClass((WNDCLASSEXA *)&wc, TRUE);
    164165    if(winclass == NULL) {
Note: See TracChangeset for help on using the changeset viewer.