HMENU TaLocale_LoadMenu (int idm) { const MENUTEMPLATE *pTemplate; if ((pTemplate = (const MENUTEMPLATE *)TaLocale_GetResource (RT_MENU, MAKEINTRESOURCE( idm ), TaLocale_GetLanguage())) == NULL) return NULL; return LoadMenuIndirect (pTemplate); }
HMENU FBALoadMenu(HINSTANCE hInstance, LPTSTR lpMenuName) { // Try to load the translated menu if (bLocalisationActive && hInstance == hAppInst && (unsigned int)lpMenuName < nMaxResources && FBAResourceInfo[(unsigned int)lpMenuName].pResourceTranslation) { return LoadMenuIndirect((MENUTEMPLATE*)FBAResourceInfo[(unsigned int)lpMenuName].pResourceTranslation); } // Translation unavailable, so use normal function return LoadMenu(hInstance, lpMenuName); }
HMENU winResLoadMenu(LPCTSTR menuName) { UCHAR * b = winResGetResource(RT_MENU, menuName); if(b != NULL) { HMENU menu = LoadMenuIndirect((CONST MENUTEMPLATE *)b); if(menu != NULL) return menu; } return LoadMenu(NULL, menuName); }
static HWND ShowMenuHeapItem( heap_list *hl, HWND parent ) { HWND hdl; HMENU menu; void __far *ptr; ResInfo *info; info = MemAlloc( sizeof( ResInfo ) ); if( info == NULL ) return( NULL ); info->type = GD_MENU; ptr = LockResource( hl->info.ge.hBlock ); info->hdl = hl->info.ge.hBlock; info->res = ptr; info->menu_const = NULL; menu = LoadMenuIndirect( ptr ); hdl = MkDisplayWin( STR_MENU, parent ); SetWindowLong( hdl, 0, (DWORD)info ); SetMenu( hdl, menu ); ShowWindow( hdl, SW_SHOWNORMAL ); return( hdl ); }