From 95aa036670a1ce2c461ffd9bd3a586d191ee4675 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 19 Jul 2012 22:48:01 +0000 Subject: - various icolib fixes; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@1061 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TabSRMM/src/msgs.cpp | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'plugins/TabSRMM/src') diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 4593a3ea43..1a5a9780d0 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -1046,26 +1046,27 @@ static int GetIconPackVersion(HMODULE hDLL) static int TSAPI SetupIconLibConfig() { - SKINICONDESC sid = { 0 }; - char szFilename[MAX_PATH]; int i = 0, j = 2, version = 0, n = 0; - strncpy(szFilename, "icons\\tabsrmm_icons.dll", MAX_PATH); - g_hIconDLL = LoadLibraryA(szFilename); + TCHAR szFilename[MAX_PATH]; + _tcsncpy(szFilename, _T("icons\\tabsrmm_icons.dll"), MAX_PATH); + g_hIconDLL = LoadLibrary(szFilename); if (g_hIconDLL == 0) { CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE|MB_ICONERROR|MB_OK); return 0; } - GetModuleFileNameA(g_hIconDLL, szFilename, MAX_PATH); + GetModuleFileName(g_hIconDLL, szFilename, MAX_PATH); if (PluginConfig.m_chat_enabled) Chat_AddIcons(); version = GetIconPackVersion(g_hIconDLL); FreeLibrary(g_hIconDLL); g_hIconDLL = 0; + SKINICONDESC sid = { 0 }; sid.cbSize = sizeof(SKINICONDESC); - sid.pszDefaultFile = szFilename; + sid.ptszDefaultFile = szFilename; + sid.flags = SIDF_PATH_TCHAR; while (ICONBLOCKS[n].szSection) { i = 0; @@ -1075,7 +1076,7 @@ static int TSAPI SetupIconLibConfig() sid.pszDescription = ICONBLOCKS[n].idesc[i].szDesc; sid.iDefaultIndex = ICONBLOCKS[n].idesc[i].uId == -IDI_HISTORY ? 0 : ICONBLOCKS[n].idesc[i].uId; // workaround problem /w icoLib and a resource id of 1 (actually, a Windows problem) i++; - if (n>0&&n<4) + if (n > 0 && n < 4) PluginConfig.g_buttonBarIconHandles[j++] = Skin_AddIcon(&sid); else Skin_AddIcon(&sid); @@ -1084,13 +1085,12 @@ static int TSAPI SetupIconLibConfig() } sid.pszSection = "TabSRMM/Default"; - sid.pszName = "tabSRMM_clock_symbol"; sid.pszDescription = "Clock symbol (for the info panel clock)"; sid.iDefaultIndex = -IDI_CLOCK; Skin_AddIcon(&sid); - strncpy(szFilename, "plugins\\tabsrmm.dll", MAX_PATH); + _tcsncpy(szFilename, _T("plugins\\tabsrmm.dll"), MAX_PATH); sid.pszName = "tabSRMM_overlay_disabled"; sid.pszDescription = "Feature disabled (used as overlay)"; @@ -1101,8 +1101,6 @@ static int TSAPI SetupIconLibConfig() sid.pszDescription = "Feature enabled (used as overlay)"; sid.iDefaultIndex = -IDI_FEATURE_ENABLED; Skin_AddIcon(&sid); - - return 1; } -- cgit v1.2.3