MIR_CORE_DLL(void) TranslateMenu_LP(HMENU hMenu, int _hLangpack) { MUUID *uuid = Langpack_LookupUuid(_hLangpack); MENUITEMINFO mii = { 0 }; mii.cbSize = sizeof(mii); for (int i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) { TCHAR str[256]; mii.fMask = MIIM_TYPE | MIIM_SUBMENU; mii.dwTypeData = (TCHAR*)str; mii.cch = _countof(str); GetMenuItemInfo(hMenu, i, TRUE, &mii); if (mii.cch && mii.dwTypeData) { TCHAR *result = (TCHAR*)LangPackTranslateString(uuid, (const char*)mii.dwTypeData, TRUE); if (result != mii.dwTypeData) { mii.dwTypeData = result; mii.fMask = MIIM_TYPE; SetMenuItemInfo(hMenu, i, TRUE, &mii); } } if (mii.hSubMenu != NULL) TranslateMenu_LP(mii.hSubMenu, _hLangpack); } }
static void TranslateWindow( HWND hwnd ) { TCHAR title[2048]; GetWindowText(hwnd, title, SIZEOF( title )); { TCHAR* result = ( TCHAR* )LangPackTranslateString(( char* )title, FLAGS ); if ( result != title ) SetWindowText(hwnd, result ); } }
static void TranslateWindow(MUUID *pUuid, HWND hwnd) { TCHAR title[2048]; GetWindowText(hwnd, title, _countof(title)); TCHAR *result = (TCHAR*)LangPackTranslateString(pUuid, (const char*)title, TRUE); if (result != title) SetWindowText(hwnd, result); }
MIR_CORE_DLL(WCHAR*) TranslateW_LP(const WCHAR *str, int _hLangpack) { return (WCHAR*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), (LPCSTR)str, TRUE); }
MIR_CORE_DLL(char*) TranslateA_LP(const char *str, int _hLangpack) { return (char*)LangPackTranslateString(Langpack_LookupUuid(_hLangpack), str, FALSE); }