summaryrefslogtreecommitdiff
path: root/plugins/Alarms/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/Alarms/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/Alarms/src/icons.cpp')
-rw-r--r--plugins/Alarms/src/icons.cpp40
1 files changed, 18 insertions, 22 deletions
diff --git a/plugins/Alarms/src/icons.cpp b/plugins/Alarms/src/icons.cpp
index d1f1fc7e93..d02534df31 100644
--- a/plugins/Alarms/src/icons.cpp
+++ b/plugins/Alarms/src/icons.cpp
@@ -1,8 +1,6 @@
#include "common.h"
#include "icons.h"
-HANDLE hIcoLibIconsChanged;
-
HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
int ReloadIcons(WPARAM wParam, LPARAM lParam)
@@ -10,7 +8,7 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam)
hIconMenuSet = Skin_GetIcon("alarms_menu_set");
hIconList1 = Skin_GetIcon("alarms_list1");
hIconList2 = Skin_GetIcon("alarms_list2");
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
hIconMenuShowHide = Skin_GetIcon("alarms_menu_showhide");
RefreshReminderFrame();
@@ -19,44 +17,42 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam)
void InitIcons()
{
- SKINICONDESC sid = {0};
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInst, path, MAX_PATH);
- sid.cbSize = sizeof(SKINICONDESC);
+ SKINICONDESC sid = { sizeof(sid) };
sid.pszSection = "Alarms";
+ sid.ptszDefaultFile = path;
+ sid.flags = SIDF_PATH_TCHAR;
- sid.pszDescription = "Menu: Set Alarm";
+ sid.pszDescription = LPGEN("Menu: Set Alarm");
sid.pszName = "alarms_menu_set";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 0;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
- sid.pszDescription = "Reminder: Soon";
+ sid.pszDescription = LPGEN("Reminder: Soon");
sid.pszName = "alarms_list1";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 1;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS ); Skin_AddIcon(&sid);
+ sid.iDefaultIndex = -IDI_LIST1;
- sid.pszDescription = "Reminder: Very Soon";
+ sid.pszDescription = LPGEN("Reminder: Very Soon");
sid.pszName = "alarms_list2";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 2;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ sid.iDefaultIndex = -IDI_LIST2;
Skin_AddIcon(&sid);
- sid.pszDescription = "Alarm: System Tray";
+ sid.pszDescription = LPGEN("Alarm: System Tray");
sid.pszName = "alarms_systray";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 3;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- sid.pszDescription = "Menu: Show/Hide Reminders";
+ if ( !ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
+ sid.pszDescription = LPGEN("Menu: Show/Hide Reminders");
sid.pszName = "alarms_menu_showhide";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 4;
- sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
+ sid.iDefaultIndex = -IDI_MAINMENU;
Skin_AddIcon(&sid);
hIconMenuShowHide = Skin_GetIcon("alarms_menu_showhide");
@@ -67,5 +63,5 @@ void InitIcons()
hIconList2 = Skin_GetIcon("alarms_list2");
hIconSystray = Skin_GetIcon("alarms_systray");
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}