Ignore:
Timestamp:
Jul 20, 1999, 9:42:36 AM (26 years ago)
Author:
sandervl
Message:

Accelerator support (not working) + bugfixes

File:
1 edited

Legend:

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

    r336 r342  
    1 /* $Id: loadres.cpp,v 1.2 1999-07-19 11:50:04 sandervl Exp $ */
     1/* $Id: loadres.cpp,v 1.3 1999-07-20 07:42:35 sandervl Exp $ */
    22
    33/*
     
    6363
    6464    dprintf(("LoadCursor from %X returned %d\n", hinst, rc));
    65     return(rc);
    66 }
    67 //******************************************************************************
    68 //******************************************************************************
    69 HACCEL WIN32API LoadAcceleratorsA(HINSTANCE hinst, LPCSTR lpszAcc)
    70 {
    71  HACCEL rc;
    72 
    73     if((int)lpszAcc >> 16 != 0) {//convert string name identifier to numeric id
    74          dprintf(("lpszAcc %s\n", lpszAcc));
    75          lpszAcc = (LPCSTR)ConvertNameId(hinst, (char *)lpszAcc);
    76     }
    77     else dprintf(("lpszAcc %d\n", (int)lpszAcc));
    78  
    79     rc = O32_LoadAccelerators(hinst, lpszAcc);
    80 
    81     dprintf(("LoadAccelerators returned %d\n", rc));
    8265    return(rc);
    8366}
     
    10790  return(rc);
    10891}
    109 
    110 //******************************************************************************
    111 //******************************************************************************
    112 HACCEL WIN32API LoadAcceleratorsW(HINSTANCE hinst, LPCWSTR lpszAccel)
    113 {
    114  char   *astring = NULL;
    115  HACCEL rc;
    116 
    117     if((int)lpszAccel >> 16 != 0) {//convert string name identifier to numeric id
    118          astring = UnicodeToAsciiString((LPWSTR)lpszAccel);
    119 
    120          dprintf(("lpszAccel %s\n", astring));
    121          lpszAccel = (LPWSTR)ConvertNameId(hinst, (char *)astring);
    122     }
    123     else dprintf(("lpszAccel %d\n", (int)lpszAccel));
    124 
    125     rc = O32_LoadAccelerators(hinst, (char *)lpszAccel);
    126     if(astring)
    127         FreeAsciiString(astring);
    128 
    129     dprintf(("LoadAcceleratorsW returned %d\n", rc));
    130     return(rc);
    131 }
    13292//******************************************************************************
    13393//******************************************************************************
     
    197157//******************************************************************************
    198158//******************************************************************************
    199 HMENU WIN32API LoadMenuA(HINSTANCE hinst, LPCSTR lpszMenu)
    200 {
    201  HMENU rc;
    202 
    203 #if 1
    204     rc = (HMENU)FindResourceA(hinst, lpszMenu, RT_MENUA);
    205 #else
    206     if((int)lpszMenu >> 16 != 0) {//convert string name identifier to numeric id
    207          dprintf(("lpszMenu %s\n", lpszMenu));
    208 
    209          lpszMenu = (LPCSTR)ConvertNameId(hinst, (char *)lpszMenu);
    210     }
    211     else dprintf(("lpszMenu %d\n", (int)lpszMenu));
    212 
    213     rc = O32_LoadMenu(hinst, lpszMenu);
    214 #endif
    215     dprintf(("LoadMenuA (%X) returned %d\n", hinst, rc));
    216     return(rc);
    217 }
    218 //******************************************************************************
    219 //******************************************************************************
    220 HMENU 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));
    241     return(rc);
    242 }
    243 //******************************************************************************
    244 //******************************************************************************
    245 HMENU WIN32API LoadMenuIndirectA( const MENUITEMTEMPLATEHEADER * arg1)
    246 {
    247  char  *astring = NULL;
    248  HMENU rc;
    249 
    250     dprintf(("OS2LoadMenuIndirectA\n"));
    251 
    252     rc = O32_LoadMenuIndirect(arg1);
    253     if(astring)
    254         FreeAsciiString(astring);
    255     return(rc);
    256 }
    257 //******************************************************************************
    258 //Won't work...
    259 //******************************************************************************
    260 HMENU WIN32API LoadMenuIndirectW(const MENUITEMTEMPLATEHEADER * arg1)
    261 {
    262     dprintf(("OS2LoadMenuIndirectW, improperly implemented!!\n"));
    263 
    264     return 0;
    265 //    return O32_LoadMenuIndirect(arg1);
    266 }
    267159//******************************************************************************
    268160//TODO: Far from complete, but works for loading resources from exe
Note: See TracChangeset for help on using the changeset viewer.