diff options
author | George Hazan <george.hazan@gmail.com> | 2012-12-01 13:25:11 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-12-01 13:25:11 +0000 |
commit | 854959cbc0a1bad2c086214be4d1a829b17a61f3 (patch) | |
tree | ee3de50f4b4e57f54ae20d139f97fa469ff90d34 /plugins/NoHistory/src/icons.cpp | |
parent | 73ddc73d92675399e4619758d4b0881418de0a6d (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/NoHistory/src/icons.cpp')
-rw-r--r-- | plugins/NoHistory/src/icons.cpp | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/plugins/NoHistory/src/icons.cpp b/plugins/NoHistory/src/icons.cpp index 6bfff6a424..bb13603c41 100644 --- a/plugins/NoHistory/src/icons.cpp +++ b/plugins/NoHistory/src/icons.cpp @@ -13,34 +13,33 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) { return 0;
}
-void InitIcons() {
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(SKINICONDESC);
+void InitIcons()
+{
+ SKINICONDESC sid = { sizeof(sid) };
- sid.ptszSection = _T(MODULE);
- sid.flags = SIDF_ALL_TCHAR;
+ sid.pszSection = MODULE;
+ sid.flags = SIDF_PATH_TCHAR;
- TCHAR path[MAX_PATH];
- GetModuleFileName(hInst,path,MAX_PATH);
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInst,path,MAX_PATH);
+ sid.ptszDefaultFile = path;
-#define AddIcon(x,y,z) \
- sid.ptszDescription = x; \
- sid.pszName = y; \
- sid.ptszDefaultFile = path; \
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(z), IMAGE_ICON, 0, 0, 0); \
- Skin_AddIcon(&sid); \
- sid.iDefaultIndex++;
+#define AddIcon(x,y,z) \
+ sid.pszDescription = x; \
+ sid.pszName = y; \
+ sid.iDefaultIndex = -z; \
+ Skin_AddIcon(&sid); \
+ sid.iDefaultIndex++;
- AddIcon(LPGENT("Disable"), MODULE "_remove", IDI_HREMOVE);
- AddIcon(LPGENT("Enable"), MODULE "_keep", IDI_HKEEP);
- AddIcon(LPGENT("Clear"), MODULE "_clear", IDI_HCLEAR);
+ AddIcon( LPGEN("Disable"), MODULE "_remove", IDI_HREMOVE);
+ AddIcon( LPGEN("Enable"), MODULE "_keep", IDI_HKEEP);
+ AddIcon( LPGEN("Clear"), MODULE "_clear", IDI_HCLEAR);
#undef AddIcon
- ReloadIcons(0, 0);
-
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ ReloadIcons(0, 0);
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
void DeinitIcons() {
|