MCPcopy Create free account
hub / github.com/WinMerge/winmerge / GetResourceString

Method GetResourceString

ShellExtension/Common/WinMergeContextMenu.cpp:443–462  ·  view source on GitHub ↗

* @brief Load a string from resource. * @param [in] Resource string ID. * @return String loaded from resource. */

Source from the content-addressed store, hash-verified

441 * @return String loaded from resource.
442 */
443std::wstring WinMergeContextMenu::GetResourceString(UINT id) const
444{
445 if (!s_pLang)
446 s_pLang = new CLanguageSelect();
447 if (m_langID == 0)
448 {
449 CRegKeyEx reg;
450 if (reg.Open(HKEY_CURRENT_USER, f_RegLocaleDir) == ERROR_SUCCESS)
451 m_langID = static_cast<LANGID>(reg.ReadDword(f_LanguageId, m_langID));
452 }
453 if (s_pLang->GetLangId() != m_langID)
454 {
455 TCHAR szFileName[1024] = {0};
456 GetModuleFileName(m_hInstance, szFileName, sizeof(szFileName) / sizeof(TCHAR));
457 PathRemoveFileSpec(szFileName);
458 String languagesFolder = String(szFileName) + _T("\\Languages\\ShellExtension");
459 s_pLang->LoadLanguageFile(m_langID, languagesFolder);
460 }
461 return s_pLang->GetResourceString(m_hInstance, id);
462}

Callers

nothing calls this directly

Calls 4

OpenMethod · 0.45
ReadDwordMethod · 0.45
GetLangIdMethod · 0.45
LoadLanguageFileMethod · 0.45

Tested by

no test coverage detected