From 854959cbc0a1bad2c086214be4d1a829b17a61f3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 1 Dec 2012 13:25:11 +0000 Subject: icolib: icon creation quirks git-svn-id: http://svn.miranda-ng.org/main/trunk@2588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/New_GPG/src/icons.cpp | 41 +++++++++++++++-------------------------- 1 file changed, 15 insertions(+), 26 deletions(-) (limited to 'plugins/New_GPG/src/icons.cpp') diff --git a/plugins/New_GPG/src/icons.cpp b/plugins/New_GPG/src/icons.cpp index 90ad051b75..890a7abbf5 100755 --- a/plugins/New_GPG/src/icons.cpp +++ b/plugins/New_GPG/src/icons.cpp @@ -16,41 +16,30 @@ #include "commonheaders.h" -HANDLE IconLibDefine(TCHAR* desc, TCHAR* section, char* ident, HICON icon, char* def_file, int def_idx, int size) -{ - SKINICONDESC sid = {0}; - HANDLE hIcon; - - if(!size) - size = 16; +extern HINSTANCE hInst; - sid.cbSize = sizeof( SKINICONDESC ); - sid.ptszSection = section; - sid.ptszDescription = desc; - sid.flags = SIDF_TCHAR; +HANDLE IconLibDefine(char* desc, char* ident, TCHAR* def_file, int def_idx) +{ + SKINICONDESC sid = { sizeof(sid) }; + sid.pszSection = szGPGModuleName; + sid.pszDescription = desc; + sid.flags = SIDF_PATH_TCHAR; sid.pszName = ident; - sid.pszDefaultFile = def_file; - sid.iDefaultIndex = def_idx; - sid.hDefaultIcon = icon; - sid.cx = sid.cy = size; - - hIcon = Skin_AddIcon(&sid); - - return hIcon; + sid.ptszDefaultFile = def_file; + sid.iDefaultIndex = -def_idx; + sid.cx = sid.cy = 16; + return Skin_AddIcon(&sid); } void InitIconLib() { - extern HINSTANCE hInst; - char lib[MAX_PATH]; - GetModuleFileNameA(hInst, lib, MAX_PATH); - TCHAR *module = mir_a2t(szGPGModuleName); + TCHAR lib[MAX_PATH]; + GetModuleFileName(hInst, lib, MAX_PATH); - IconLibDefine(_T("Secured"), module, "secured", NULL, lib, -IDI_SECURED,0); - IconLibDefine(_T("Unsecured"), module, "unsecured", NULL, lib, -IDI_UNSECURED,0); - mir_free(module); + IconLibDefine( "Secured", "secured", lib, IDI_SECURED); + IconLibDefine( "Unsecured", "unsecured", lib, IDI_UNSECURED); } HICON IconLibGetIcon(const char* ident) -- cgit v1.2.3