Ignore:
Timestamp:
Dec 9, 1999, 1:54:05 AM (26 years ago)
Author:
sandervl
Message:

Unicode <-> Ascii translation changes + fixes for window procedures

File:
1 edited

Legend:

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

    r2016 r2033  
    1 /* $Id: win32wbase.cpp,v 1.107 1999-12-07 20:43:39 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.108 1999-12-09 00:53:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    268268//******************************************************************************
    269269//******************************************************************************
     270BOOL Win32BaseWindow::IsWindowUnicode()
     271{
     272    return (WINPROC_GetProcType(getWindowProc()) == WIN_PROC_32W);
     273}
     274//******************************************************************************
     275//******************************************************************************
    270276BOOL Win32BaseWindow::CreateWindowExA(CREATESTRUCTA *cs, ATOM classAtom)
    271277{
     
    434440  }
    435441
    436   setWindowProc(windowClass->getWindowProc());
     442  WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, windowClass->getWindowProc(), (isUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_WINDOW);
    437443  hInstance = cs->hInstance;
    438444  dwStyle   = cs->style & ~WS_VISIBLE;
     
    627633  /* Get class or window DC if needed */
    628634  if(windowClass->getStyle() & CS_OWNDC) {
    629         dprintf(("Class with CS_OWNDC style"));
    630 //      ownDC = GetWindowDC(getWindowHandle());
    631   }
    632   else 
     635    dprintf(("Class with CS_OWNDC style"));
     636//  ownDC = GetWindowDC(getWindowHandle());
     637  }
     638  else
    633639  if (windowClass->getStyle() & CS_PARENTDC)  {
    634         dprintf(("ERROR: Class with CS_PARENTDC style -> NOT IMPLEMENTED!"));
    635         ownDC = 0;
     640    dprintf(("ERROR: Class with CS_PARENTDC style -> NOT IMPLEMENTED!"));
     641    ownDC = 0;
    636642  }
    637643  else
    638644  if (windowClass->getStyle() & CS_CLASSDC)  {
    639         dprintf(("ERROR: Class with CS_CLASSDC style -> NOT IMPLEMENTED!"));
    640         ownDC = 0;
     645    dprintf(("ERROR: Class with CS_CLASSDC style -> NOT IMPLEMENTED!"));
     646    ownDC = 0;
    641647  }
    642648  /* Set the window menu */
     
    15191525//******************************************************************************
    15201526//******************************************************************************
    1521 LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam, BOOL fReentered)
    1522 {
    1523     //Lotus Notes v5.0.1 calls SetWindowTextA for unicode static window -> calls DefWindowProcA
    1524     if(IsUnicode() && !fReentered) {
    1525         return DefWindowProcW(Msg, wParam, lParam);
    1526     }
     1527LRESULT Win32BaseWindow::DefWindowProcA(UINT Msg, WPARAM wParam, LPARAM lParam)
     1528{
    15271529    switch(Msg)
    15281530    {
     
    17771779
    17781780    case WM_NOTIFYFORMAT:
    1779         if (IsUnicode()) return NFR_UNICODE;
     1781        if (IsWindowUnicode()) return NFR_UNICODE;
    17801782        else return NFR_ANSI;
    17811783
     
    18511853
    18521854    default:
    1853         return DefWindowProcA(Msg, wParam, lParam, TRUE);
     1855        return DefWindowProcA(Msg, wParam, lParam);
    18541856    }
    18551857}
     
    29502952BOOL Win32BaseWindow::SetWindowTextA(LPSTR lpsz)
    29512953{
    2952     //hmm. Notes v5.0.1 creates static window with CreateWindowExW and calls this...
    2953     if(IsUnicode() && lpsz) {
    2954         LPWSTR lpWindowNameW = (LPWSTR)alloca((strlen(lpsz)+1)*sizeof(WCHAR));
    2955         lstrcpyAtoW(lpWindowNameW, lpsz);
    2956 
    2957         return SendInternalMessageW(WM_SETTEXT,0,(LPARAM)lpWindowNameW);
    2958     }
    29592954    return SendInternalMessageA(WM_SETTEXT,0,(LPARAM)lpsz);
    29602955}
     
    29752970//******************************************************************************
    29762971//******************************************************************************
    2977 LONG Win32BaseWindow::SetWindowLongA(int index, ULONG value)
     2972LONG Win32BaseWindow::SetWindowLongA(int index, ULONG value, BOOL fUnicode)
    29782973{
    29792974 LONG oldval;
     
    30183013        }
    30193014        case GWL_WNDPROC:
    3020                 oldval = (LONG)getWindowProc();
    3021                 setWindowProc((WNDPROC)value);
     3015                oldval = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
     3016                WINPROC_SetProc((HWINDOWPROC *)&win32wndproc, (WNDPROC)value, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A, WIN_PROC_WINDOW);
    30223017                return oldval;
    30233018        case GWL_HINSTANCE:
     
    30483043//******************************************************************************
    30493044//******************************************************************************
    3050 ULONG Win32BaseWindow::GetWindowLongA(int index)
     3045ULONG Win32BaseWindow::GetWindowLongA(int index, BOOL fUnicode)
    30513046{
    30523047 ULONG value;
     
    30603055        break;
    30613056    case GWL_WNDPROC:
    3062         value = (ULONG)getWindowProc();
     3057        value = (LONG)WINPROC_GetProc(win32wndproc, (fUnicode) ? WIN_PROC_32W : WIN_PROC_32A);
    30633058        break;
    30643059    case GWL_HINSTANCE:
Note: See TracChangeset for help on using the changeset viewer.