summaryrefslogtreecommitdiff
path: root/plugins/New_GPG/src/icons.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-12-01 13:25:11 +0000
commit854959cbc0a1bad2c086214be4d1a829b17a61f3 (patch)
treeee3de50f4b4e57f54ae20d139f97fa469ff90d34 /plugins/New_GPG/src/icons.cpp
parent73ddc73d92675399e4619758d4b0881418de0a6d (diff)
icolib: icon creation quirks
git-svn-id: http://svn.miranda-ng.org/main/trunk@2588 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/New_GPG/src/icons.cpp')
-rwxr-xr-xplugins/New_GPG/src/icons.cpp41
1 files changed, 15 insertions, 26 deletions
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)