Changeset 336 for trunk/src


Ignore:
Timestamp:
Jul 19, 1999, 1:50:04 PM (26 years ago)
Author:
sandervl
Message:

Menus are displayed now

Location:
trunk/src/user32/new
Files:
3 edited

Legend:

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

    r300 r336  
    1 /* $Id: loadres.cpp,v 1.1 1999-07-14 08:35:34 sandervl Exp $ */
     1/* $Id: loadres.cpp,v 1.2 1999-07-19 11:50:04 sandervl Exp $ */
    22
    33/*
     
    201201 HMENU rc;
    202202
     203#if 1
     204    rc = (HMENU)FindResourceA(hinst, lpszMenu, RT_MENUA);
     205#else
    203206    if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id
    204207         dprintf(("lpszMenu %s\n", lpszMenu));
     
    209212
    210213    rc = O32_LoadMenu(hinst, lpszMenu);
    211 
     214#endif
    212215    dprintf(("LoadMenuA (%X) returned %d\n", hinst, rc));
     216    return(rc);
     217}
     218//******************************************************************************
     219//******************************************************************************
     220HMENU WIN32API LoadMenuW(HINSTANCE hinst, LPCWSTR lpszMenu)
     221{
     222 HMENU rc;
     223
     224#if 1
     225    rc = (HMENU)FindResourceW(hinst, lpszMenu, RT_MENUW);
     226#else
     227 char  *astring = NULL;
     228    if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id
     229         astring = UnicodeToAsciiString((LPWSTR)lpszMenu);
     230
     231         dprintf(("lpszMenu %s\n", astring));
     232         lpszMenu = (LPWSTR)ConvertNameId(hinst, (char *)astring);
     233    }
     234    else dprintf(("lpszMenu %d\n", (int)lpszMenu));
     235
     236    rc  = O32_LoadMenu(hinst, (char *)lpszMenu);
     237    if(astring)
     238        FreeAsciiString(astring);
     239#endif
     240    dprintf(("LoadMenuW (%X) returned %d\n", hinst, rc));
    213241    return(rc);
    214242}
     
    236264    return 0;
    237265//    return O32_LoadMenuIndirect(arg1);
    238 }
    239 //******************************************************************************
    240 //******************************************************************************
    241 HMENU WIN32API LoadMenuW(HINSTANCE hinst, LPCWSTR lpszMenu)
    242 {
    243  char  *astring = NULL;
    244  HMENU rc;
    245 
    246     if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id
    247          astring = UnicodeToAsciiString((LPWSTR)lpszMenu);
    248 
    249          dprintf(("lpszMenu %s\n", astring));
    250          lpszMenu = (LPWSTR)ConvertNameId(hinst, (char *)astring);
    251     }
    252     else dprintf(("lpszMenu %d\n", (int)lpszMenu));
    253 
    254     rc  = O32_LoadMenu(hinst, (char *)lpszMenu);
    255     if(astring)
    256         FreeAsciiString(astring);
    257 
    258     dprintf(("LoadMenuA (%X) returned %d\n", hinst, rc));
    259     return(rc);
    260266}
    261267//******************************************************************************
  • trunk/src/user32/new/makefile

    r334 r336  
    1 # $Id: makefile,v 1.11 1999-07-18 20:41:12 cbratschi Exp $
     1# $Id: makefile,v 1.12 1999-07-19 11:50:04 sandervl Exp $
    22
    33#
     
    3737
    3838
    39 $(TARGET).dll: $(OBJS) $(TARGET).def
     39$(TARGET).dll: $(OBJS) $(TARGET).def $(TARGET).res
    4040        $(LD) $(LDFLAGS) -Fm -Fe$@ $(OBJS) $(TARGET).def \
    4141              $(PDWIN32_LIB)/pmwinx.lib $(PDWIN32_LIB)/gdi32.lib $(PDWIN32_LIB)/kernel32.lib $(PDWIN32_LIB)/libuls.lib
     42        rc $(TARGET).res $(TARGET).dll
    4243        $(CP) $@ $(PDWIN32_BIN)
    4344
     45$(TARGET).res:
     46        rc -r user32.rc user32.res
    4447
    4548$(TARGET).lib: $(TARGET)exp.def
  • trunk/src/user32/new/win32wnd.cpp

    r332 r336  
    1 /* $Id: win32wnd.cpp,v 1.13 1999-07-18 18:04:30 sandervl Exp $ */
     1/* $Id: win32wnd.cpp,v 1.14 1999-07-19 11:50:04 sandervl Exp $ */
    22/*
    33 * Win32 Window Code for OS/2
     
    2929#include <oslibutil.h>
    3030#include <oslibgdi.h>
     31#include <winres.h>
    3132
    3233#define HAS_DLGFRAME(style,exStyle) \
     
    10321033BOOL Win32Window::SetMenu(ULONG hMenu)
    10331034{
    1034  PVOID menutemplate;
    1035 
     1035 PVOID          menutemplate;
     1036 Win32Resource *winres = (Win32Resource *)hMenu;
     1037
     1038#if 1
     1039    if(winres == NULL) {
     1040        dprintf(("Win32Window:: Win32Resource *winres == 0"));
     1041        return FALSE;
     1042    }
     1043    menutemplate = winres->lockOS2Resource();
     1044    if(menutemplate == NULL)
     1045    {
     1046        dprintf(("Win32Window::SetMenu menutemplate == 0"));
     1047        return FALSE;
     1048    }
     1049    OS2HwndMenu = OSLibWinCreateMenu(OS2HwndFrame, menutemplate);
     1050    if(OS2HwndMenu == 0) {
     1051        dprintf(("Win32Window::SetMenu OS2HwndMenu == 0"));
     1052        return FALSE;
     1053    }
     1054    return TRUE;
     1055#else
    10361056   if(HMHandleTranslateToOS2(hMenu, (PULONG)&menutemplate) == NO_ERROR)
    10371057   {
     
    10441064   dprintf(("Win32Window::SetMenu unknown hMenu (%x)", hMenu));
    10451065   return FALSE;
     1066#endif
    10461067}
    10471068//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.