summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AddContactPlus/main.cpp2
-rw-r--r--plugins/Alarms/alarms.cpp4
-rw-r--r--plugins/Alarms/icons.cpp114
-rw-r--r--plugins/Alarms/icons.h1
-rw-r--r--plugins/AuthState/main.cpp82
-rw-r--r--plugins/BASS_interface/Main.cpp2
-rw-r--r--plugins/BasicHistory/BasicHistory.cpp18
-rw-r--r--plugins/BossKeyPlus/BossKey.cpp2
-rw-r--r--plugins/BuddyExpectator/BuddyExpectator.cpp82
-rw-r--r--plugins/CSList/cslist.cpp8
-rw-r--r--plugins/ChangeKeyboardLayout/hook_events.c51
-rw-r--r--plugins/Chat/options.c2
-rw-r--r--plugins/Clist_modern/modern_clc.cpp93
-rw-r--r--plugins/Clist_modern/modern_clui.cpp13
-rw-r--r--plugins/Clist_modern/modern_viewmodebar.cpp410
-rw-r--r--plugins/Clist_mw/clui.cpp22
-rw-r--r--plugins/Console/Console.c20
-rw-r--r--plugins/CountryFlags/icons.c2
-rw-r--r--plugins/Db_autobackups/main.c2
-rw-r--r--plugins/Dbx_mmap_SA/dialogs.c4
-rw-r--r--plugins/FavContacts/src/main.cpp17
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp2
-rw-r--r--plugins/Gender/main.cpp43
-rw-r--r--plugins/HistorySweeperLight/options.c2
-rw-r--r--plugins/IgnoreState/main.cpp2
-rw-r--r--plugins/MenuItemEx/main.c4
-rw-r--r--plugins/MetaContacts/icons.c2
-rw-r--r--plugins/NewXstatusNotify/main.cpp2
-rw-r--r--plugins/Nudge/main.cpp35
-rw-r--r--plugins/PackUpdater/Src/Utils.cpp2
-rw-r--r--plugins/Popup/src/icons.cpp2
-rw-r--r--plugins/Popup/src/main.cpp16
-rw-r--r--plugins/Popup/src/notifications.cpp2
-rw-r--r--plugins/QuickMessages/Utils.c2
-rw-r--r--plugins/QuickReplies/events.cpp42
-rw-r--r--plugins/Rate/main.cpp16
-rw-r--r--plugins/SRMM/globals.c2
-rw-r--r--plugins/Scriver/globals.c2
-rw-r--r--plugins/SecureIM/loadicons.cpp32
-rw-r--r--plugins/Sessions/Src/Main.cpp11
-rw-r--r--plugins/Sessions/Src/Utils.cpp4
-rw-r--r--plugins/Sessions/Src/Utils.h2
-rw-r--r--plugins/SimpleStatusMsg/utils.cpp2
-rw-r--r--plugins/SmileyAdd/main.cpp4
-rw-r--r--plugins/SpellChecker/spellchecker.cpp4
-rw-r--r--plugins/Svc_crshdmp/crshdmp_icons.cpp2
-rw-r--r--plugins/Svc_dbepp/headers.h1
-rw-r--r--plugins/Svc_dbepp/icons.cpp32
-rw-r--r--plugins/Svc_dbepp/main.cpp8
-rw-r--r--plugins/TabSRMM/chat/options.cpp110
-rw-r--r--plugins/TabSRMM/src/msgs.cpp10
-rw-r--r--plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp25
-rw-r--r--plugins/Updater/icons.cpp2
-rw-r--r--plugins/UserInfoEx/classPsTreeItem.cpp4
-rw-r--r--plugins/Variables/variables.cpp34
-rw-r--r--plugins/WhenWasIt/icons.cpp52
56 files changed, 635 insertions, 833 deletions
diff --git a/plugins/AddContactPlus/main.cpp b/plugins/AddContactPlus/main.cpp
index 402b9d5ecb..95f1fac93d 100644
--- a/plugins/AddContactPlus/main.cpp
+++ b/plugins/AddContactPlus/main.cpp
@@ -160,7 +160,7 @@ static int OnModulesLoaded(WPARAM, LPARAM)
sid.iDefaultIndex = -IDI_ADDCONTACT;
sid.ptszDescription = LPGENT("Add Contact");
sid.pszName = ICON_ADD;
- hIconLibItem = (HANDLE)CallService(MS_SKIN2_ADDICON, (WPARAM)0, (LPARAM)&sid);
+ hIconLibItem = Skin_AddIcon(&sid);
hChangedIcons = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
HOTKEYDESC hkd = {0};
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp
index c0dc60bb85..3c0a198716 100644
--- a/plugins/Alarms/alarms.cpp
+++ b/plugins/Alarms/alarms.cpp
@@ -294,10 +294,10 @@ static int MainInit(WPARAM wparam,LPARAM lparam) {
return 0;
}
-static int MainDeInit(WPARAM wParam, LPARAM lParam) {
+static int MainDeInit(WPARAM wParam, LPARAM lParam)
+{
DeinitFrames();
DeinitList();
- DeinitIcons();
return 0;
}
diff --git a/plugins/Alarms/icons.cpp b/plugins/Alarms/icons.cpp
index fe6abf834d..5a07541e27 100644
--- a/plugins/Alarms/icons.cpp
+++ b/plugins/Alarms/icons.cpp
@@ -5,7 +5,8 @@ HANDLE hIcoLibIconsChanged;
HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
-int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+int ReloadIcons(WPARAM wParam, LPARAM lParam)
+{
hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
@@ -16,76 +17,55 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) {
return 0;
}
-void InitIcons() {
- if (ServiceExists(MS_SKIN2_ADDICON)) {
- SKINICONDESC sid = {0};
-
- sid.cbSize = sizeof(SKINICONDESC);
- sid.pszSection = Translate("Alarms");
-
- sid.pszDescription = Translate("Menu: Set Alarm");
- sid.pszName = "alarms_menu_set";
+void InitIcons()
+{
+ SKINICONDESC sid = {0};
+
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.pszSection = "Alarms";
+
+ sid.pszDescription = "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);
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = "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.pszDescription = "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 );
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = "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 );
+ Skin_AddIcon(&sid);
+
+ if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
+ sid.pszDescription = "Menu: Show/Hide Reminders";
+ sid.pszName = "alarms_menu_showhide";
sid.pszDefaultFile = "alarms.dll";
- sid.iDefaultIndex = 0;
+ sid.iDefaultIndex = 4;
sid.hDefaultIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("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 );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("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 );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("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 );
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
- sid.pszDescription = Translate("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);
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
- hIconMenuShowHide = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_showhide");
- }
-
- hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
- hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
- hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
- hIconSystray = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_systray");
-
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
- } else {
- hIconMenuSet = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconList1 = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST1), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconList2 = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_LIST2), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- hIconSystray = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
- hIconMenuShowHide = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINMENU), IMAGE_ICON, 16, 16, 0);//LR_LOADTRANSPARENT | LR_LOADMAP3DCOLORS );
+ hIconMenuShowHide = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_showhide");
}
-}
+ hIconMenuSet = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_menu_set");
+ hIconList1 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list1");
+ hIconList2 = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_list2");
+ hIconSystray = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"alarms_systray");
-void DeinitIcons() {
- if (!ServiceExists(MS_SKIN2_ADDICON)) {
- DestroyIcon(hIconMenuSet);
- DestroyIcon(hIconList1);
- DestroyIcon(hIconList2);
- DestroyIcon(hIconSystray);
- if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME))
- DestroyIcon(hIconMenuShowHide);
- }
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
diff --git a/plugins/Alarms/icons.h b/plugins/Alarms/icons.h
index 89226dd5d4..d47228f952 100644
--- a/plugins/Alarms/icons.h
+++ b/plugins/Alarms/icons.h
@@ -6,7 +6,6 @@
extern HICON hIconMenuSet, hIconList1, hIconList2, hIconMenuShowHide, hIconSystray;
void InitIcons();
-void DeinitIcons();
#endif
diff --git a/plugins/AuthState/main.cpp b/plugins/AuthState/main.cpp
index 890e3689b1..91e80262c4 100644
--- a/plugins/AuthState/main.cpp
+++ b/plugins/AuthState/main.cpp
@@ -151,20 +151,10 @@ int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
g_IECAuthGrant.cbSize = sizeof(IconExtraColumn);
g_IECAuthGrant.ColumnType = clistIcon;
- if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON))
- {
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0);
- g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0);
- g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0);
- }
- else
- {
- g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTH), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0);
- g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_GRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0);
- g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTHGRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0);
- }
+ if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) {
+ g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0);
+ g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0);
+ g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0);
}
return 0;
@@ -236,40 +226,34 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- // hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild);
- // hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying);
// IcoLib support
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid = {0};
- ZeroMemory(&sid, sizeof(sid));
- TCHAR szFile[MAX_PATH];
- sid.cbSize = sizeof(sid);
- sid.flags = SIDF_ALL_TCHAR;
-
- sid.ptszSection = _T("Auth State");
- GetModuleFileName(g_hInst, szFile, MAX_PATH);
- sid.ptszDefaultFile = szFile;
-
- sid.ptszDescription = _T("Auth");
- sid.pszName = "auth_icon";
- sid.iDefaultIndex = -IDI_AUTH;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.ptszDescription = _T("Grant");
- sid.pszName = "grant_icon";
- sid.iDefaultIndex = -IDI_GRANT;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.ptszDescription = _T("Auth & Grant");
- sid.pszName = "authgrant_icon";
- sid.iDefaultIndex = -IDI_AUTHGRANT;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- // hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
- }
+ SKINICONDESC sid = {0};
+ ZeroMemory(&sid, sizeof(sid));
+ TCHAR szFile[MAX_PATH];
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_ALL_TCHAR;
+
+ sid.ptszSection = _T("Auth State");
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+ sid.ptszDefaultFile = szFile;
+
+ sid.ptszDescription = _T("Auth");
+ sid.pszName = "auth_icon";
+ sid.iDefaultIndex = -IDI_AUTH;
+ Skin_AddIcon(&sid);
+
+ sid.ptszDescription = _T("Grant");
+ sid.pszName = "grant_icon";
+ sid.iDefaultIndex = -IDI_GRANT;
+ Skin_AddIcon(&sid);
+
+ sid.ptszDescription = _T("Auth & Grant");
+ sid.pszName = "authgrant_icon";
+ sid.iDefaultIndex = -IDI_AUTHGRANT;
+ Skin_AddIcon(&sid);
+
+ // extra icons
hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon");
-
if (hExtraIcon != NULL)
{
// Set initial value for all contacts
@@ -280,8 +264,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
}
- else
- {
+ else {
hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild);
hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying);
@@ -291,8 +274,7 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
// Updater support
- if (ServiceExists(MS_UPDATE_REGISTER))
- {
+ if (ServiceExists(MS_UPDATE_REGISTER)) {
Update update = {0};
char szVersion[16];
diff --git a/plugins/BASS_interface/Main.cpp b/plugins/BASS_interface/Main.cpp
index fa214604b9..e667325770 100644
--- a/plugins/BASS_interface/Main.cpp
+++ b/plugins/BASS_interface/Main.cpp
@@ -333,7 +333,7 @@ void InitIcons(void)
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconLibItem[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/BasicHistory/BasicHistory.cpp b/plugins/BasicHistory/BasicHistory.cpp
index 975cd061ed..9d1a3f0204 100644
--- a/plugins/BasicHistory/BasicHistory.cpp
+++ b/plugins/BasicHistory/BasicHistory.cpp
@@ -233,47 +233,47 @@ void InitIcolib()
sid.pszName = "BasicHistory_in";
sid.ptszDescription = LPGENT("Incoming message");
sid.iDefaultIndex = -IDI_INM;
- hEventIcons[0] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hEventIcons[0] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_out";
sid.ptszDescription = LPGENT("Outgoing message");
sid.iDefaultIndex = -IDI_OUTM;
- hEventIcons[1] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hEventIcons[1] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_status";
sid.ptszDescription = LPGENT("Statuschange");
sid.iDefaultIndex = -IDI_STATUS;
- hEventIcons[2] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hEventIcons[2] = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_show";
sid.ptszDescription = LPGENT("Show Contacts");
sid.iDefaultIndex = -IDI_SHOW;
- hPlusIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hPlusIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_hide";
sid.ptszDescription = LPGENT("Hide Contacts");
sid.iDefaultIndex = -IDI_HIDE;
- hMinusIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hMinusIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_findnext";
sid.ptszDescription = LPGENT("Find Next");
sid.iDefaultIndex = -IDI_FINDNEXT;
- hFindNextIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hFindNextIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_findprev";
sid.ptszDescription = LPGENT("Find Previous");
sid.iDefaultIndex = -IDI_FINDPREV;
- hFindPrevIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hFindPrevIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_plusex";
sid.ptszDescription = LPGENT("Plus in export");
sid.iDefaultIndex = -IDI_PLUSEX;
- hPlusExIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hPlusExIcon = Skin_AddIcon(&sid);
sid.pszName = "BasicHistory_minusex";
sid.ptszDescription = LPGENT("Minus in export");
sid.iDefaultIndex = -IDI_MINUSEX;
- hMinusExIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hMinusExIcon = Skin_AddIcon(&sid);
}
void InitUpdater()
diff --git a/plugins/BossKeyPlus/BossKey.cpp b/plugins/BossKeyPlus/BossKey.cpp
index 6888a5347b..08d9dceed0 100644
--- a/plugins/BossKeyPlus/BossKey.cpp
+++ b/plugins/BossKeyPlus/BossKey.cpp
@@ -625,7 +625,7 @@ static int IcoLibInit (void) // Icolib support
sid.pszName = "hidemim";
sid.ptszDescription = _T("Hide Miranda IM");
sid.iDefaultIndex = -IDI_DLGPASSWD;
- g_hIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ g_hIcon = Skin_AddIcon(&sid);
return 0;
}
diff --git a/plugins/BuddyExpectator/BuddyExpectator.cpp b/plugins/BuddyExpectator/BuddyExpectator.cpp
index 19e02d446a..e31bdf06c2 100644
--- a/plugins/BuddyExpectator/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/BuddyExpectator.cpp
@@ -484,15 +484,7 @@ INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam)
*/
int onIconsChanged(WPARAM wParam, LPARAM lParam)
{
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon");
- }
- else
- {
- hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0);
- }
-
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon");
return 0;
}
@@ -563,16 +555,7 @@ int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
g_IECMissYou.ColumnType = options.MissYouIcon;
if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON))
- {
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0);
- }
- else
- {
- g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ENABLED), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0);
- }
- }
+ g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0);
return 0;
}
@@ -767,48 +750,43 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
}
// IcoLib support
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
- sid.pszDefaultFile = szFile;
- sid.cbSize = SKINICONDESC_SIZE_V1;
-
- sid.pszSection = Translate("BuddyExpectator");
+ SKINICONDESC sid = {0};
+ char szFile[MAX_PATH];
+ GetModuleFileNameA(hInst, szFile, MAX_PATH);
+ sid.pszDefaultFile = szFile;
+ sid.cbSize = sizeof(sid);
+ sid.pszSection = "BuddyExpectator";
- sid.pszDescription = Translate("Tray/popup icon");
- sid.pszName = "main_icon";
- sid.iDefaultIndex = -IDI_MAINICON;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.pszDescription = "Tray/popup icon";
+ sid.pszName = "main_icon";
+ sid.iDefaultIndex = -IDI_MAINICON;
+ Skin_AddIcon(&sid);
- sid.pszDescription = Translate("Enabled");
- sid.pszName = "enabled_icon";
- sid.iDefaultIndex = -IDI_ENABLED;
- hEnabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.pszDescription = "Enabled";
+ sid.pszName = "enabled_icon";
+ sid.iDefaultIndex = -IDI_ENABLED;
+ hEnabledIcon = Skin_AddIcon(&sid);
- sid.pszDescription = Translate("Disabled");
- sid.pszName = "disabled_icon";
- sid.iDefaultIndex = -IDI_DISABLED;
- hDisabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.pszDescription = "Disabled";
+ sid.pszName = "disabled_icon";
+ sid.iDefaultIndex = -IDI_DISABLED;
+ hDisabledIcon = Skin_AddIcon(&sid);
- sid.pszDescription = Translate("Hide");
- sid.pszName = "hide_icon";
- sid.iDefaultIndex = -IDI_HIDE;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.pszDescription = "Hide";
+ sid.pszName = "hide_icon";
+ sid.iDefaultIndex = -IDI_HIDE;
+ Skin_AddIcon(&sid);
- sid.pszDescription = Translate("NeverHide");
- sid.pszName = "neverhide_icon";
- sid.iDefaultIndex = -IDI_NEVERHIDE;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.pszDescription = "NeverHide";
+ sid.pszName = "neverhide_icon";
+ sid.iDefaultIndex = -IDI_NEVERHIDE;
+ Skin_AddIcon(&sid);
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
- }
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
onIconsChanged(0,0);
- if (options.enableMissYou)
- {
+ if (options.enableMissYou) {
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
CLISTMENUITEM mi = {0};
diff --git a/plugins/CSList/cslist.cpp b/plugins/CSList/cslist.cpp
index 42740beb52..5050ec39f5 100644
--- a/plugins/CSList/cslist.cpp
+++ b/plugins/CSList/cslist.cpp
@@ -323,9 +323,6 @@ void CSList::setStatus( WORD code, StatusItem* item, char* protoName)
void CSList::initIcoLib( )
{
- if ( !ServiceExists( MS_SKIN2_ADDICON ))
- return;
-
// init icons of buttons
TCHAR tszFile[MAX_PATH];
GetModuleFileName( CSList::handle, tszFile, MAX_PATH );
@@ -337,15 +334,14 @@ void CSList::initIcoLib( )
sid.cx = sid.cy = 16;
sid.ptszSection = _T(MODULENAME);
- for ( int i = 0; i < SIZEOF(forms); i++ )
- {
+ for (int i=0; i < SIZEOF(forms); i++ ) {
char szSettingName[64];
mir_snprintf( szSettingName, SIZEOF(szSettingName), "%s_%s", __INTERNAL_NAME, forms[i].pszIconIcoLib );
sid.pszName = szSettingName;
sid.ptszDescription = forms[i].ptszDescr;
sid.iDefaultIndex = -forms[i].iconNoIcoLib;
- forms[i].hIcoLibItem = ( HANDLE )CallService( MS_SKIN2_ADDICON, 0, ( LPARAM )&sid );
+ forms[i].hIcoLibItem = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/ChangeKeyboardLayout/hook_events.c b/plugins/ChangeKeyboardLayout/hook_events.c
index 37f317a448..5fb03491ee 100644
--- a/plugins/ChangeKeyboardLayout/hook_events.c
+++ b/plugins/ChangeKeyboardLayout/hook_events.c
@@ -108,16 +108,8 @@ void RegPopupActions()
int OnIconsChanged(WPARAM wParam, LPARAM lParam)
{
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- hPopupIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_popup_icon");
- hCopyIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_copy_icon");
- }
- else
- {
- hPopupIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUPICON), IMAGE_ICON, 16, 16, 0);
- hCopyIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_COPYICON), IMAGE_ICON, 16, 16, 0);
- }
+ hPopupIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_popup_icon");
+ hCopyIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"ckl_copy_icon");
RegPopupActions();
return 0;
}
@@ -132,7 +124,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
LPSTR ptszTemp;
SKINICONDESC sid = {0};
- CHAR szFile[MAX_PATH];
+ TCHAR szFile[MAX_PATH];
//Çàïîëíÿåì êîíôèãóðàöèîííûå ñòðîêè èç áàçû. Åñëè èõ òàì íåò - ãåíåðèðóåì.
@@ -178,25 +170,24 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hChangeTextLayout = CreateServiceFunction(MS_CKL_CHANGETEXTLAYOUT, APIChangeTextLayout);
// IcoLib support
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
- sid.pszDefaultFile = szFile;
- sid.cbSize = SKINICONDESC_SIZE;
-
- sid.pszSection = Translate(ModuleName);
- sid.pszDescription = Translate("Popup");
- sid.pszName = "ckl_popup_icon";
- sid.iDefaultIndex = -IDI_POPUPICON;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszDescription = Translate("Copy to clipboard");
- sid.pszName = "ckl_copy_icon";
- sid.iDefaultIndex = -IDI_COPYICON;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
- }
+ GetModuleFileName(hInst, szFile, MAX_PATH);
+ sid.ptszDefaultFile = szFile;
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_PATH_TCHAR;
+
+ sid.pszSection = Translate(ModuleName);
+ sid.pszDescription = Translate("Popup");
+ sid.pszName = "ckl_popup_icon";
+ sid.iDefaultIndex = -IDI_POPUPICON;
+ Skin_AddIcon(&sid);
+
+ sid.pszDescription = Translate("Copy to clipboard");
+ sid.pszName = "ckl_copy_icon";
+ sid.iDefaultIndex = -IDI_COPYICON;
+ Skin_AddIcon(&sid);
+
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnIconsChanged);
+
OnIconsChanged(0, 0);
RegPopupActions();
diff --git a/plugins/Chat/options.c b/plugins/Chat/options.c
index 1e25f541e7..c80b0c1871 100644
--- a/plugins/Chat/options.c
+++ b/plugins/Chat/options.c
@@ -493,7 +493,7 @@ void AddIcons(void)
sid.pszDescription = (char*)iconList[i].szDescr;
sid.pszName = (char*)iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
} }
// load icons from the skinning module if available
diff --git a/plugins/Clist_modern/modern_clc.cpp b/plugins/Clist_modern/modern_clc.cpp
index 1e05581498..e4626ceb63 100644
--- a/plugins/Clist_modern/modern_clc.cpp
+++ b/plugins/Clist_modern/modern_clc.cpp
@@ -67,8 +67,8 @@ static int clcExitDragToScroll();
static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- int i;
- if (MirandaExiting()) return 0;
+ if (MirandaExiting())
+ return 0;
ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernOptInit);
ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernSkinOptInit);
@@ -79,67 +79,46 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
// Get icons
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid={0};
- char szMyPath[MAX_PATH];
- int i;
-
- GetModuleFileNameA(g_hInst, szMyPath, MAX_PATH);
-
- sid.cbSize = sizeof(sid);
- sid.cx=16;
- sid.cy=16;
- sid.pszDefaultFile = szMyPath;
-
- sid.pszSection = LPGEN("Contact List");
- sid.pszDescription = LPGEN("Listening to");
- sid.pszName = "LISTENING_TO_ICON";
- sid.iDefaultIndex = - IDI_LISTENING_TO;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszSection = LPGEN("Contact List/Avatar Overlay");
+ int i;
- for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
- {
- sid.pszDescription = g_pAvatarOverlayIcons[i].description;
- sid.pszName = g_pAvatarOverlayIcons[i].name;
- sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
- sid.pszSection = LPGEN("Contact List/Status Overlay");
+ TCHAR szMyPath[MAX_PATH];
+ GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
+
+ SKINICONDESC sid={0};
+ sid.cbSize = sizeof(sid);
+ sid.cx = 16;
+ sid.cy = 16;
+ sid.ptszDefaultFile = szMyPath;
+ sid.flags = SIDF_PATH_TCHAR;
+
+ sid.pszSection = LPGEN("Contact List");
+ sid.pszDescription = LPGEN("Listening to");
+ sid.pszName = "LISTENING_TO_ICON";
+ sid.iDefaultIndex = - IDI_LISTENING_TO;
+ Skin_AddIcon(&sid);
+
+ sid.pszSection = LPGEN("Contact List/Avatar Overlay");
+ for (i=0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
+ sid.pszDescription = g_pAvatarOverlayIcons[i].description;
+ sid.pszName = g_pAvatarOverlayIcons[i].name;
+ sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
+ Skin_AddIcon(&sid);
+ }
- for (i = 0 ; i < MAX_REGS(g_pStatusOverlayIcons) ; i++)
- {
- sid.pszDescription = g_pStatusOverlayIcons[i].description;
- sid.pszName = g_pStatusOverlayIcons[i].name;
- sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
+ sid.pszSection = LPGEN("Contact List/Status Overlay");
+ for (i=0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
+ sid.pszDescription = g_pStatusOverlayIcons[i].description;
+ sid.pszName = g_pStatusOverlayIcons[i].name;
+ sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
+ Skin_AddIcon(&sid);
+ }
- clcHookIconsChanged(0,0);
+ clcHookIconsChanged(0,0);
- hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
- }
- else
- {
- if (hAvatarOverlays) ImageList_Destroy(hAvatarOverlays);
- hAvatarOverlays=ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
- for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
- {
- HICON hIcon=LoadSmallIcon(g_hInst, MAKEINTRESOURCE(g_pAvatarOverlayIcons[i].id));
- g_pAvatarOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
- DestroyIcon_protect(hIcon);
- hIcon=LoadSmallIcon(g_hInst, MAKEINTRESOURCE(g_pStatusOverlayIcons[i].id));
- g_pStatusOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
- DestroyIcon_protect(hIcon);
- }
- g_hListeningToIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_LISTENING_TO), IMAGE_ICON, 16, 16, 0);
- }
+ hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
- if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
- {
+ if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
SMADD_REGCAT rc;
rc.cbSize = sizeof(rc);
diff --git a/plugins/Clist_modern/modern_clui.cpp b/plugins/Clist_modern/modern_clui.cpp
index 5929ecfc87..80c9937763 100644
--- a/plugins/Clist_modern/modern_clui.cpp
+++ b/plugins/Clist_modern/modern_clui.cpp
@@ -1071,8 +1071,7 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,bool
if (hi) has_proto_icon=TRUE;
if (hi && nf) DestroyIcon(hi);
}
- if (!UseLibrary||!ServiceExists(MS_SKIN2_ADDICON))
- {
+ if (!UseLibrary) {
hIcon=CLUI_ExtractIconFromPath(szFullPath,needFree);
if (hIcon) return hIcon;
if (UseLibrary)
@@ -1082,10 +1081,8 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,bool
if (hIcon) return hIcon;
}
}
- else
- {
- if (registerit&&IconName!=NULL&&SectName!=NULL)
- {
+ else {
+ if (registerit && IconName != NULL && SectName != NULL) {
sid.cbSize = sizeof(sid);
sid.cx=16;
sid.cy=16;
@@ -1096,7 +1093,7 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,bool
sid.pszDefaultFile=internalidx<0?szMyPath:szPath;
sid.iDefaultIndex=(UseLibrary&2)?i:(internalidx<0)?internalidx:-internalidx;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
return ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
}
@@ -1864,7 +1861,7 @@ HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szD
sid.iDefaultIndex = 0;
sid.hDefaultIcon = LoadSmallIcon( hDefaultModuleInst, MAKEINTRESOURCE(iDefaultResource));
}
- hIcolibItem = ( HANDLE )CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIcolibItem = Skin_AddIcon(&sid);
if ( sid.hDefaultIcon ) DestroyIcon(sid.hDefaultIcon);
return hIcolibItem;
}
diff --git a/plugins/Clist_modern/modern_viewmodebar.cpp b/plugins/Clist_modern/modern_viewmodebar.cpp
index ae385f77bb..38f7e42f97 100644
--- a/plugins/Clist_modern/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/modern_viewmodebar.cpp
@@ -1069,90 +1069,83 @@ void BuildViewModeMenu()
LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
+ switch(msg)
{
- case WM_CREATE:
- {
- HWND hwndButton;
+ case WM_CREATE:
+ {
+ HWND hwndButton;
RECT rcMargins={12,0,2,0};
- hwndSelector = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, 20, 20,
- hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
- SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), 0);
+ hwndSelector = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, 20, 20,
+ hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
+ SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), 0);
SendMessage(hwndSelector, BUTTONSETMARGINS,0 ,(LPARAM) &rcMargins);
SendMessage(hwndSelector, BUTTONSETID,0 ,(LPARAM) "ViewMode.Select" );
SendMessage(hwndSelector, WM_SETFONT,0 ,(LPARAM) FONTID_VIEMODES+1 );
SendMessage(hwndSelector, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndSelector, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- SendMessage(hwndSelector, BUTTONSETSENDONDOWN, 0 ,(LPARAM) 1 );
-
+ SendMessage(hwndSelector, BUTTONSETSENDONDOWN, 0 ,(LPARAM) 1 );
+
//SendMessage(hwndSelector, BM_SETASMENUACTION, 1, 0);
- hwndButton = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), 0);
+ hwndButton = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), 0);
SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Setup" );
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- hwndButton = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_RESETMODES, g_hInst, NULL);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), 0);
+ hwndButton = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwnd, (HMENU) IDC_RESETMODES, g_hInst, NULL);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), 0);
SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Clear" );
SendMessage(hwnd, WM_USER + 100, 0, 0);
SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- return FALSE;
- }
- case WM_NCCALCSIZE:
- return 18;// FrameNCCalcSize(hwnd, DefWindowProc, wParam, lParam, hasTitleBar);
- case WM_SIZE:
- {
- RECT rcCLVMFrame;
- HDWP PosBatch = BeginDeferWindowPos(3);
- GetClientRect(hwnd, &rcCLVMFrame);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
- rcCLVMFrame.right - 23, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
- rcCLVMFrame.right - 45, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
- 1, 1, rcCLVMFrame.right - 46, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- EndDeferWindowPos(PosBatch);
- break;
- }
- case WM_USER + 100:
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), MBM_SETICOLIBHANDLE, 0,
- (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_reset", "Contact List",Translate("Reset view mode"), _T("clisticons.dll"),9, g_hInst, IDI_RESETVIEW ));
-
- SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), MBM_SETICOLIBHANDLE, 0,
- (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_set", "Contact List",Translate("Setup view modes"), _T("clisticons.dll"), 10, g_hInst, IDI_SETVIEW ));
- }
- else
- {
- SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_DELETE), IMAGE_ICON, 16, 16, LR_SHARED));
- SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_RENAME), IMAGE_ICON, 16, 16, LR_SHARED));
- //SendMessage(GetDlgItem(hwnd, IDC_SELECTMODE), BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_CHAT), IMAGE_ICON, 16, 16, LR_SHARED));
- }
- {
- int bSkinned = ModernGetSettingByte(NULL, "CLCExt", "bskinned", 0);
- int i = 0;
-
- while(_buttons[i] != 0) {
- //SendMessage(GetDlgItem(hwnd, _buttons[i]), BM_SETSKINNED, 0, bSkinned);
- if(1&&bSkinned) {
- SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 0);
- }
- else {
- SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 1);
- SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 1);
- }
- i++;
- }
- }
- if(g_CluiData.bFilterEffective)
- {
-
+ return FALSE;
+ }
+ case WM_NCCALCSIZE:
+ return 18;// FrameNCCalcSize(hwnd, DefWindowProc, wParam, lParam, hasTitleBar);
+ case WM_SIZE:
+ {
+ RECT rcCLVMFrame;
+ HDWP PosBatch = BeginDeferWindowPos(3);
+ GetClientRect(hwnd, &rcCLVMFrame);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
+ rcCLVMFrame.right - 23, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
+ rcCLVMFrame.right - 45, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
+ 1, 1, rcCLVMFrame.right - 46, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ EndDeferWindowPos(PosBatch);
+ break;
+ }
+ case WM_USER + 100:
+ SendMessage(GetDlgItem(hwnd, IDC_RESETMODES), MBM_SETICOLIBHANDLE, 0,
+ (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_reset", "Contact List",Translate("Reset view mode"), _T("clisticons.dll"),9, g_hInst, IDI_RESETVIEW ));
+
+ SendMessage(GetDlgItem(hwnd, IDC_CONFIGUREMODES), MBM_SETICOLIBHANDLE, 0,
+ (LPARAM) RegisterIcolibIconHandle("CLN_CLVM_set", "Contact List",Translate("Setup view modes"), _T("clisticons.dll"), 10, g_hInst, IDI_SETVIEW ));
+
+ {
+ int bSkinned = ModernGetSettingByte(NULL, "CLCExt", "bskinned", 0);
+ int i = 0;
+
+ while(_buttons[i] != 0) {
+ //SendMessage(GetDlgItem(hwnd, _buttons[i]), BM_SETSKINNED, 0, bSkinned);
+ if(1&&bSkinned) {
+ SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 0);
+ SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 0);
+ }
+ else {
+ SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 1);
+ SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 1);
+ }
+ i++;
+ }
+ }
+
+ if(g_CluiData.bFilterEffective)
+ {
+
{
TCHAR * temp;
//temp=alloca((strlen(szSetting)+1)*sizeof(TCHAR));
@@ -1164,153 +1157,150 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
}
- }
- else
- SetWindowText(GetDlgItem(hwnd, IDC_SELECTMODE), TranslateT("All contacts"));
- break;
- case WM_ERASEBKGND:
- if (g_CluiData.fDisableSkinEngine)
- return sttDrawViewModeBackground(hwnd, (HDC)wParam, NULL);
- else
- return 0;
- case WM_NCPAINT:
- case WM_PAINT:
- /*if ( g_CluiData.fDisableSkinEngine )
+ }
+ else
+ SetWindowText(GetDlgItem(hwnd, IDC_SELECTMODE), TranslateT("All contacts"));
+ break;
+ case WM_ERASEBKGND:
+ if (g_CluiData.fDisableSkinEngine)
+ return sttDrawViewModeBackground(hwnd, (HDC)wParam, NULL);
+ else
+ return 0;
+ case WM_NCPAINT:
+ case WM_PAINT:
+ /*if ( g_CluiData.fDisableSkinEngine )
+ {
+ PAINTSTRUCT ps;
+ HDC hdc=BeginPaint(hwnd,&ps);
+ if (hdc)
+ {
+ HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ FillRect(hdc,&ps.rcPaint,br);
+ }
+ EndPaint(hwnd,&ps);
+ }
+ else
+ */
+ if (GetParent(hwnd)==pcli->hwndContactList && g_CluiData.fLayered)
+ {
+ ValidateRect(hwnd,NULL);
+ }
+ else if (GetParent(hwnd)!=pcli->hwndContactList || !g_CluiData.fLayered)
+ {
+ HDC hdc, hdc2;
+ HBITMAP hbmp,hbmpo;
+ RECT rc={0};
+ GetClientRect(hwnd,&rc);
+ rc.right++;
+ rc.bottom++;
+ hdc = GetDC(hwnd);
+ hdc2=CreateCompatibleDC(hdc);
+ hbmp=ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
+
+ if ( g_CluiData.fDisableSkinEngine )
{
- PAINTSTRUCT ps;
- HDC hdc=BeginPaint(hwnd,&ps);
- if (hdc)
- {
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
- FillRect(hdc,&ps.rcPaint,br);
- }
- EndPaint(hwnd,&ps);
+ sttDrawViewModeBackground( hwnd, hdc2, &rc );
}
else
- */
- if (GetParent(hwnd)==pcli->hwndContactList && g_CluiData.fLayered)
{
- ValidateRect(hwnd,NULL);
- }
- else if (GetParent(hwnd)!=pcli->hwndContactList || !g_CluiData.fLayered)
- {
- HDC hdc, hdc2;
- HBITMAP hbmp,hbmpo;
- RECT rc={0};
- GetClientRect(hwnd,&rc);
- rc.right++;
- rc.bottom++;
- hdc = GetDC(hwnd);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
-
- if ( g_CluiData.fDisableSkinEngine )
+ if (GetParent(hwnd)!=pcli->hwndContactList)
{
- sttDrawViewModeBackground( hwnd, hdc2, &rc );
+ HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ FillRect(hdc2,&rc,br);
}
else
- {
- if (GetParent(hwnd)!=pcli->hwndContactList)
- {
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
- FillRect(hdc2,&rc,br);
- }
- else
- ske_BltBackImage(hwnd,hdc2,&rc);
+ ske_BltBackImage(hwnd,hdc2,&rc);
- DrawViewModeBar(hwnd,hdc2);
- }
-
+ DrawViewModeBar(hwnd,hdc2);
+ }
+
+ {
+ int i;
+ for (i=0; _buttons[i]!=0; i++)
{
- int i;
- for (i=0; _buttons[i]!=0; i++)
- {
- RECT childRect;
- RECT MyRect;
- POINT Offset;
- GetWindowRect(hwnd,&MyRect);
- GetWindowRect(GetDlgItem(hwnd, _buttons[i]),&childRect);
- Offset.x=childRect.left-MyRect.left;;
- Offset.y=childRect.top-MyRect.top;
- SendMessage(GetDlgItem(hwnd, _buttons[i]),BUTTONDRAWINPARENT,(WPARAM)hdc2,(LPARAM)&Offset);
+ RECT childRect;
+ RECT MyRect;
+ POINT Offset;
+ GetWindowRect(hwnd,&MyRect);
+ GetWindowRect(GetDlgItem(hwnd, _buttons[i]),&childRect);
+ Offset.x=childRect.left-MyRect.left;;
+ Offset.y=childRect.top-MyRect.top;
+ SendMessage(GetDlgItem(hwnd, _buttons[i]),BUTTONDRAWINPARENT,(WPARAM)hdc2,(LPARAM)&Offset);
- }
}
- BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,
- hdc2,rc.left,rc.top,SRCCOPY);
- SelectObject(hdc2,hbmpo);
- DeleteObject(hbmp);
- mod_DeleteDC(hdc2);
+ }
+ BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,
+ hdc2,rc.left,rc.top,SRCCOPY);
+ SelectObject(hdc2,hbmpo);
+ DeleteObject(hbmp);
+ mod_DeleteDC(hdc2);
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ReleaseDC(hwnd,hdc);
- ValidateRect(hwnd,NULL);
- }
- return 0;
- case WM_NOTIFY:
+ ReleaseDC(hwnd,hdc);
+ ValidateRect(hwnd,NULL);
+ }
+ return 0;
+
+ case WM_NOTIFY:
+ if (((LPNMHDR) lParam)->code==BUTTONNEEDREDRAW)
+ pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
+ return 0;
+
+ case WM_TIMER:
+ switch(wParam) {
+ case TIMERID_VIEWMODEEXPIRE:
{
- if (((LPNMHDR) lParam)->code==BUTTONNEEDREDRAW)
- pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
- return 0;
- }
-
- case WM_TIMER:
- {
- switch(wParam)
- {
- case TIMERID_VIEWMODEEXPIRE:
- {
- POINT pt;
- RECT rcCLUI;
+ POINT pt;
+ RECT rcCLUI;
- GetWindowRect(pcli->hwndContactList, &rcCLUI);
- GetCursorPos(&pt);
- if(PtInRect(&rcCLUI, pt))
- break;
+ GetWindowRect(pcli->hwndContactList, &rcCLUI);
+ GetCursorPos(&pt);
+ if(PtInRect(&rcCLUI, pt))
+ break;
- KillTimer(hwnd, wParam);
- if (!g_CluiData.old_viewmode[0])
- SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
- else
- ApplyViewMode((const char *)g_CluiData.old_viewmode);
- break;
- }
- }
- break;
- }
- case WM_COMMAND:
- {
- switch(LOWORD(wParam)) {
- case IDC_SELECTMODE:
- {
- RECT rc;
- POINT pt;
- int selection;
- MENUITEMINFO mii = {0};
- TCHAR szTemp[256];
-
- BuildViewModeMenu();
- //GetWindowRect(GetDlgItem(hwnd, IDC_SELECTMODE), &rc);
- GetWindowRect((HWND)lParam, &rc);
- pt.x = rc.left;
- pt.y = rc.bottom;
- selection = TrackPopupMenu(hViewModeMenu,TPM_RETURNCMD|TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, GetParent(hwnd), NULL);
+ KillTimer(hwnd, wParam);
+ if (!g_CluiData.old_viewmode[0])
+ SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
+ else
+ ApplyViewMode((const char *)g_CluiData.old_viewmode);
+ break;
+ }
+ }
+ break;
+
+ case WM_COMMAND:
+ {
+ switch(LOWORD(wParam)) {
+ case IDC_SELECTMODE:
+ {
+ RECT rc;
+ POINT pt;
+ int selection;
+ MENUITEMINFO mii = {0};
+ TCHAR szTemp[256];
+
+ BuildViewModeMenu();
+ //GetWindowRect(GetDlgItem(hwnd, IDC_SELECTMODE), &rc);
+ GetWindowRect((HWND)lParam, &rc);
+ pt.x = rc.left;
+ pt.y = rc.bottom;
+ selection = TrackPopupMenu(hViewModeMenu,TPM_RETURNCMD|TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, GetParent(hwnd), NULL);
PostMessage(hwnd, WM_NULL, 0, 0);
- if(selection)
+ if(selection)
{
-
+
if(selection == 10001)
goto clvm_config_command;
else if(selection == 10002)
goto clvm_reset_command;
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_STRING;
- mii.dwTypeData = szTemp;
- mii.cch = 256;
- GetMenuItemInfo(hViewModeMenu, selection, FALSE, &mii);
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_STRING;
+ mii.dwTypeData = szTemp;
+ mii.cch = 256;
+ GetMenuItemInfo(hViewModeMenu, selection, FALSE, &mii);
{
char * temp=mir_utf8encodeT(szTemp);
@@ -1318,28 +1308,28 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (temp) mir_free(temp);
}
- }
- break;
- }
- case IDC_RESETMODES:
+ }
+ break;
+ }
+ case IDC_RESETMODES:
clvm_reset_command:
- ApplyViewMode( "" );
- break;
- case IDC_CONFIGUREMODES:
- {
+ ApplyViewMode( "" );
+ break;
+ case IDC_CONFIGUREMODES:
+ {
clvm_config_command:
if (!g_ViewModeOptDlg)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
- break;
- }
- }
- break;
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
+ break;
+ }
+ }
+ break;
- }
- default:
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
- return TRUE;
+ }
+ default:
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+ }
+ return TRUE;
}
static HWND hCLVMFrame;
diff --git a/plugins/Clist_mw/clui.cpp b/plugins/Clist_mw/clui.cpp
index 14079c2ac6..bddf0478e0 100644
--- a/plugins/Clist_mw/clui.cpp
+++ b/plugins/Clist_mw/clui.cpp
@@ -201,33 +201,27 @@ HICON LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean r
_snprintf(szFullPath, SIZEOF(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
}
- if (!UseLibrary||!ServiceExists(MS_SKIN2_ADDICON))
- {
+ if (!UseLibrary) {
hIcon = ExtractIconFromPath(szFullPath);
if (hIcon) return hIcon;
}
- else
- {
- if (registerit&&IconName != NULL&&SectName != NULL)
- {
+ else {
+ if (registerit && IconName != NULL && SectName != NULL) {
sid.cbSize = sizeof(sid);
sid.pszSection = SectName;
sid.pszName = IconName;
sid.pszDescription = Description;
if (strlen(szMyPath) != 0)
- {
sid.pszDefaultFile = szMyPath;
- }
sid.iDefaultIndex = internalidx;
sid.hDefaultIcon = DefIcon;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- {
- char buf[256];
- sprintf(buf,"Registring Icon %s/%s hDefaultIcon: %p\r\n",SectName,IconName,DefIcon);
- OutputDebugStringA(buf);
- }
+ Skin_AddIcon(&sid);
+
+ char buf[256];
+ sprintf(buf,"Registring Icon %s/%s hDefaultIcon: %p\r\n",SectName,IconName,DefIcon);
+ OutputDebugStringA(buf);
}
return ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
}
diff --git a/plugins/Console/Console.c b/plugins/Console/Console.c
index c0e02f994b..2a568d98fa 100644
--- a/plugins/Console/Console.c
+++ b/plugins/Console/Console.c
@@ -1311,25 +1311,25 @@ static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam)
}
if (ServiceExists(MS_TB_ADDBUTTON)) {
- SKINICONDESC sid={0};
TBButton tbb = {0};
- char szModuleFileName[MAX_PATH]={0};
-
- GetModuleFileNameA(hInst,szModuleFileName,MAX_PATH);
+ SKINICONDESC sid={0};
+ TCHAR szModuleFileName[MAX_PATH]={0};
+ GetModuleFileName(hInst, szModuleFileName, SIZEOF(szModuleFileName));
sid.cbSize = sizeof(sid);
- sid.pszSection = Translate("Console");
- sid.pszDefaultFile = szModuleFileName;
+ sid.pszSection = "Console";
+ sid.ptszDefaultFile = szModuleFileName;
+ sid.flags = SIDF_PATH_TCHAR;
- sid.pszDescription = Translate("Show");
+ sid.pszDescription = "Show";
sid.pszName = "Console_Up";
sid.iDefaultIndex = -IDI_BTN_UP;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
- sid.pszDescription = Translate("Hide");
+ sid.pszDescription = "Hide";
sid.pszName = "Console_Down";
sid.iDefaultIndex = -IDI_BTN_DN;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
tbb.cbSize = sizeof(TBButton);
tbb.pszButtonID = "console_btn";
diff --git a/plugins/CountryFlags/icons.c b/plugins/CountryFlags/icons.c
index 46bf2a9391..82dea7cabc 100644
--- a/plugins/CountryFlags/icons.c
+++ b/plugins/CountryFlags/icons.c
@@ -265,7 +265,7 @@ void InitIcons(void)
sid.hDefaultIcon=(hIcon!=NULL)?ResizeIconCentered(hIcon,sid.cx,sid.cy):NULL;
if(hIcon!=NULL) DestroyIcon(hIcon);
index=CountryNumberToIndex(countries[i].id);
- phIconHandles[index]=(HANDLE)CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ phIconHandles[index] = Skin_AddIcon(&sid);
if(sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
}
ImageList_Destroy(himl);
diff --git a/plugins/Db_autobackups/main.c b/plugins/Db_autobackups/main.c
index 87de4cb9a0..1d00a3b60f 100644
--- a/plugins/Db_autobackups/main.c
+++ b/plugins/Db_autobackups/main.c
@@ -80,7 +80,7 @@ static void IcoLibInit(void)
sid.pszName = iconList[i].szName;
sid.ptszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
}
diff --git a/plugins/Dbx_mmap_SA/dialogs.c b/plugins/Dbx_mmap_SA/dialogs.c
index 228db23f64..df13214b62 100644
--- a/plugins/Dbx_mmap_SA/dialogs.c
+++ b/plugins/Dbx_mmap_SA/dialogs.c
@@ -106,12 +106,12 @@ static int ModulesLoad(WPARAM wParam, LPARAM lParam)
sid.ptszDescription = LPGENT("Database");
sid.pszName = "database";
sid.iDefaultIndex = -IDI_ICON2;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
sid.ptszDescription = LPGENT("Change Password");
sid.pszName = "password";
sid.iDefaultIndex = -IDI_ICON3;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
menu.cbSize = sizeof(menu);
menu.flags = CMIM_ALL | CMIF_TCHAR;
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index c6dfaa7bb1..d2c4db9f6f 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -67,7 +67,7 @@ INT_PTR svcShowMenuCentered(WPARAM wParam, LPARAM lParam);
int ProcessSrmmEvent(WPARAM wParam, LPARAM lParam);
int ProcessSrmmIconClick(WPARAM wParam, LPARAM lParam);
-int g_icoFavourite=0, g_icoRegular=0;
+HANDLE g_icoFavourite=0, g_icoRegular=0;
float g_widthMultiplier = 0;
int g_maxItemWidth = 0;
@@ -186,9 +186,9 @@ int ProcessModulesLoaded(WPARAM wParam, LPARAM lParam)
StatusIconData sid = {0};
sid.cbSize = sizeof(sid);
sid.szModule = "FavContacts";
- sid.szTooltip = Translate("Favourite Contacts");
- sid.hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoFavourite);
- sid.hIconDisabled = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoRegular);
+ sid.szTooltip = "Favourite Contacts";
+ sid.hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoFavourite);
+ sid.hIconDisabled = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoRegular);
CallService(MS_MSG_ADDICON, 0, (LPARAM)&sid);
HookEvent(ME_MSG_ICONPRESSED, ProcessSrmmIconClick);
@@ -355,12 +355,12 @@ extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
sid.pszName = "favcontacts_favourite";
sid.ptszDescription = _T("Favourite Contact");
sid.iDefaultIndex = -IDI_FAVOURITE;
- g_icoFavourite = CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ g_icoFavourite = Skin_AddIcon(&sid);
sid.pszName = "favcontacts_regular";
sid.ptszDescription = _T("Regular Contact");
sid.iDefaultIndex = -IDI_REGULAR;
- g_icoRegular = CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ g_icoRegular = Skin_AddIcon(&sid);
LoadHttpApi();
@@ -753,7 +753,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL)
if (options->wMaxRecent && DBGetContactSettingByte(hContact, "FavContacts", "IsFavourite", 0))
{
DrawIconEx(hdcTemp, lpdis->rcItem.right - 18, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, g_icoFavourite), 16, 16, 0, NULL, DI_NORMAL);
+ (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)g_icoFavourite), 16, 16, 0, NULL, DI_NORMAL);
lpdis->rcItem.right -= 20;
}
@@ -1015,8 +1015,7 @@ int sttShowMenu(bool centered)
szColumn.cx = szColumn.cy = 0;
unsigned maxWidth = GetSystemMetrics(SM_CXSCREEN) * DBGetContactSettingByte(NULL, "FavContacts", "MenuWidth", 66) / 100;
- if (szMenu.cx > maxWidth)
- {
+ if (szMenu.cx > maxWidth) {
g_widthMultiplier = (float)maxWidth / szMenu.cx;
szMenu.cx *= g_widthMultiplier;
}
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
index a802975898..1f5621e89e 100644
--- a/plugins/FingerPrintModPlus/src/fingerprint.cpp
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -631,7 +631,7 @@ HICON FASTCALL LoadIconFromExternalFile(LPTSTR filename, int nLibrary, LPSTR Ico
sid.ptszDefaultFile = destfile;
sid.iDefaultIndex = -internalidx;
sid.cx = sid.cy = 16;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
hIcon = ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
}
diff --git a/plugins/Gender/main.cpp b/plugins/Gender/main.cpp
index a95d5593c9..3df2a909e8 100644
--- a/plugins/Gender/main.cpp
+++ b/plugins/Gender/main.cpp
@@ -265,33 +265,30 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
bMetaAvail = (ServiceExists(MS_MC_GETMETACONTACT) != 0);
//IcoLib support
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid = {0};
- sid.cbSize = SKINICONDESC_SIZE;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Gender");
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(g_hInst, szFile, MAX_PATH);
- sid.ptszDefaultFile = szFile;
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = LPGENT("Gender");
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+ sid.ptszDefaultFile = szFile;
- sid.ptszDescription = LPGENT("Male");
- sid.pszName = "male_icon";
- sid.iDefaultIndex = -IDI_MALE;
- g_hIconMale = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.ptszDescription = LPGENT("Male");
+ sid.pszName = "male_icon";
+ sid.iDefaultIndex = -IDI_MALE;
+ g_hIconMale = Skin_AddIcon(&sid);
- sid.ptszDescription = LPGENT("Female");
- sid.pszName = "female_icon";
- sid.iDefaultIndex = -IDI_FEMALE;
- g_hIconFemale = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.ptszDescription = LPGENT("Female");
+ sid.pszName = "female_icon";
+ sid.iDefaultIndex = -IDI_FEMALE;
+ g_hIconFemale = Skin_AddIcon(&sid);
- sid.ptszDescription = LPGENT("No info");
- sid.pszName = "menu_icon";
- sid.iDefaultIndex = -IDI_UNDEF;
- g_hIconMenu = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ sid.ptszDescription = LPGENT("No info");
+ sid.pszName = "menu_icon";
+ sid.iDefaultIndex = -IDI_UNDEF;
+ g_hIconMenu = Skin_AddIcon(&sid);
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
- }
+ hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
g_hExtraIcon = ExtraIcon_Register("gender", "Gender", "menu_icon");
if (g_hExtraIcon != NULL)
diff --git a/plugins/HistorySweeperLight/options.c b/plugins/HistorySweeperLight/options.c
index 53a2ab5bd9..f98f5dc67c 100644
--- a/plugins/HistorySweeperLight/options.c
+++ b/plugins/HistorySweeperLight/options.c
@@ -79,7 +79,7 @@ void InitIcons(void)
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconLibItem[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/IgnoreState/main.cpp b/plugins/IgnoreState/main.cpp
index 824569c959..014266df77 100644
--- a/plugins/IgnoreState/main.cpp
+++ b/plugins/IgnoreState/main.cpp
@@ -201,7 +201,7 @@ static VOID init_icolib (void)
sid.pszName = iconList[i].szName;
sid.ptszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ iconList[i].hIconLibItem = Skin_AddIcon(&sid);
}
// hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
}
diff --git a/plugins/MenuItemEx/main.c b/plugins/MenuItemEx/main.c
index 1183559159..9088aaf6c5 100644
--- a/plugins/MenuItemEx/main.c
+++ b/plugins/MenuItemEx/main.c
@@ -252,14 +252,14 @@ static void IconsInit()
sid.pszName = iconList[i].szName;
sid.ptszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
for ( i = 0; i < SIZEOF(overlayIconList); i++ ) {
sid.pszName = overlayIconList[i].szName;
sid.ptszDescription = overlayIconList[i].szDescr;
sid.iDefaultIndex = -overlayIconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
}
diff --git a/plugins/MetaContacts/icons.c b/plugins/MetaContacts/icons.c
index f10739ca0b..829636be1f 100644
--- a/plugins/MetaContacts/icons.c
+++ b/plugins/MetaContacts/icons.c
@@ -88,7 +88,7 @@ void InitIcons(void) {
sid.pszDescription = Translate(iconList[i].szDescr);
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp
index 9d149e0c3b..e2eef82117 100644
--- a/plugins/NewXstatusNotify/main.cpp
+++ b/plugins/NewXstatusNotify/main.cpp
@@ -1318,7 +1318,7 @@ void InitIcolib()
mir_snprintf(szSettingName, sizeof(szSettingName), "%s_%s", MODULE, iconList[i].szName);
sid.pszDescription = Translate(iconList[i].szDescr);
sid.iDefaultIndex = -iconList[i].iIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
}
diff --git a/plugins/Nudge/main.cpp b/plugins/Nudge/main.cpp
index 5648e052a5..cf5538c2a1 100644
--- a/plugins/Nudge/main.cpp
+++ b/plugins/Nudge/main.cpp
@@ -390,23 +390,20 @@ void RegisterToDbeditorpp(void)
void LoadIcons(void)
{
//Load icons
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid = {0};
- TCHAR szFilename[MAX_PATH];
- GetModuleFileName(hInst,szFilename,MAX_PATH);
-
- sid.cbSize = SKINICONDESC_SIZE;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Nudge");
- sid.ptszDefaultFile = szFilename;
-
- sid.pszName = "Nudge_Default";
- sid.ptszDescription = LPGENT("Nudge as Default");
- sid.iDefaultIndex = -IDI_NUDGE;
- sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE));
- g_hIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
+ SKINICONDESC sid = {0};
+ TCHAR szFilename[MAX_PATH];
+ GetModuleFileName(hInst,szFilename,MAX_PATH);
+
+ sid.cbSize = sizeof(sid);
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = LPGENT("Nudge");
+ sid.ptszDefaultFile = szFilename;
+
+ sid.pszName = "Nudge_Default";
+ sid.ptszDescription = LPGENT("Nudge as Default");
+ sid.iDefaultIndex = -IDI_NUDGE;
+ sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE));
+ g_hIcon = Skin_AddIcon(&sid);
}
// Nudge support
@@ -791,7 +788,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
mir_sntprintf(iconDesc, SIZEOF(iconDesc), TranslateT("Nudge for %s"), proto->tszAccountName);
SKINICONDESC sid = {0};
- sid.cbSize = SKINICONDESC_SIZE;
+ sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("Nudge");
sid.ptszDefaultFile = szFilename;
@@ -799,7 +796,7 @@ void Nudge_AddAccount(PROTOACCOUNT *proto)
sid.ptszDescription = iconDesc;
sid.iDefaultIndex = -IDI_NUDGE;
sid.hDefaultIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NUDGE));
- newNudge->item.hIcoLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ newNudge->item.hIcoLibItem = Skin_AddIcon(&sid);
//Add contact menu entry
CLISTMENUITEM mi = {0};
diff --git a/plugins/PackUpdater/Src/Utils.cpp b/plugins/PackUpdater/Src/Utils.cpp
index 533d1472eb..6841316644 100644
--- a/plugins/PackUpdater/Src/Utils.cpp
+++ b/plugins/PackUpdater/Src/Utils.cpp
@@ -59,7 +59,7 @@ VOID IcoLibInit()
sid.pszName = iconList[i].szIconName;
sid.ptszDescription = iconList[i].tszDescr;
sid.iDefaultIndex = -iconList[i].IconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
}
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp
index 5bfd22f49c..e33d39ec83 100644
--- a/plugins/Popup/src/icons.cpp
+++ b/plugins/Popup/src/icons.cpp
@@ -140,6 +140,6 @@ void InitIcons()
break;
}
}
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
} \ No newline at end of file
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 0a9beb7382..84b1921aa2 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -380,22 +380,6 @@ void LoadHotkey() {
//Function which makes the initializations
static int ModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- //check if 'Icon Library Manager' and 'FontService' exist (load icon and font later)
- if (!ServiceExists(MS_FONT_REGISTER) || !ServiceExists(MS_SKIN2_ADDICON)) {
- LPTSTR msg = TranslateTS(
- _T("This version of Popup Plus requires\r\n")
- _T("'Icon Library Manager' and 'FontService'\r\n")
- _T("modules.\r\n")
- _T("\r\n")
- _T("You always can download them at\r\n")
- _T("http://addons.miranda-im.org/\r\n")
- _T("\r\n")
- _T("Do you want to visit Miranda IM homepage now?\r\n"));
- if (MessageBox(NULL, msg, _T("Popup Plus Error"), MB_YESNO|MB_ICONSTOP) == IDYES)
- ShellExecute(NULL, _T("open"), _T("http://addons.miranda-im.org/"), NULL, NULL, SW_SHOWNORMAL);
- return 0;
- }
-
//check if History++ is installed
gbHppInstalled = ServiceExists(MS_HPP_GETVERSION) && ServiceExists(MS_HPP_EG_WINDOW) &&
(CallService(MS_HPP_GETVERSION, 0, 0) >= PLUGIN_MAKE_VERSION(1,5,0,112));
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index 97be02af44..3a8beb8f15 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -235,7 +235,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification)
sid.pszName = setting;
sid.pszDescription = notification->lpzName;
sid.hDefaultIcon = notification->lchIcon;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
gTreeData.insert(ptd);
return (HANDLE)ptd;
diff --git a/plugins/QuickMessages/Utils.c b/plugins/QuickMessages/Utils.c
index 41b3710664..8b80502064 100644
--- a/plugins/QuickMessages/Utils.c
+++ b/plugins/QuickMessages/Utils.c
@@ -375,7 +375,7 @@ int AddIcon(HICON icon, char *name, char *description)
sid.pszName = name;
sid.hDefaultIcon = icon;
- return CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ return Skin_AddIcon( &sid);
}
int RegisterCustomButton(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/QuickReplies/events.cpp b/plugins/QuickReplies/events.cpp
index fd4991423d..2227c6d6f1 100644
--- a/plugins/QuickReplies/events.cpp
+++ b/plugins/QuickReplies/events.cpp
@@ -35,7 +35,7 @@ INT_PTR QuickRepliesService(WPARAM, LPARAM)
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
UnhookEvent(hOnModulesLoaded);
- HICON hIcon = NULL;
+ HANDLE hIcon = NULL;
char buttonName[32];
if (!ServiceExists(MS_QUICKREPLIES_SERVICE))
@@ -43,34 +43,26 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
iNumber = 0;
hQuickRepliesService = CreateServiceFunction(MS_QUICKREPLIES_SERVICE, QuickRepliesService);
}
- else
- iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0);
+ else iNumber = DBGetContactSettingByte(NULL, MODULE_NAME, "InstancesCount", 0);
DBWriteContactSettingByte(NULL, MODULE_NAME, "InstancesCount", iNumber + 1);
hOnOptInitialized = HookEvent(ME_OPT_INITIALISE, OnOptInitialized);
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- if (ServiceExists(MS_SKIN2_ADDICON))
- {
- char buttonNameTranslated[32];
- mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1);
- mir_snprintf(buttonNameTranslated, SIZEOF(buttonNameTranslated), "%s %x",Translate("Button"), iNumber + 1);
-
- SKINICONDESC sid = {0};
- sid.cbSize = sizeof(SKINICONDESC);
- sid.pszSection = "TabSRMM/Quick Replies";
- sid.cx = sid.cy = 16;
- sid.pszDescription = buttonNameTranslated;
- sid.pszName = buttonName;
- sid.hDefaultIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
-
- hIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
- }
- else
- hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
+ char buttonNameTranslated[32];
+ mir_snprintf(buttonName, SIZEOF(buttonName), "Button %x", iNumber + 1);
+ mir_snprintf(buttonNameTranslated, SIZEOF(buttonNameTranslated), "%s %x",Translate("Button"), iNumber + 1);
- if (ServiceExists(MS_BB_ADDBUTTON))
- {
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
+ sid.pszSection = "TabSRMM/Quick Replies";
+ sid.cx = sid.cy = 16;
+ sid.pszDescription = buttonNameTranslated;
+ sid.pszName = buttonName;
+ sid.hDefaultIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_QICON));
+ hIcon = Skin_AddIcon(&sid);
+
+ if (ServiceExists(MS_BB_ADDBUTTON)) {
mir_snprintf(buttonName, SIZEOF(buttonName), MODULE_NAME" %x", iNumber + 1);
BBButton bbd = {0};
@@ -78,15 +70,13 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISLSIDEBUTTON;
bbd.pszModuleName = buttonName;
bbd.ptszTooltip = _T("Quick Replies\r\nLeft button - open menu\r\nRight button - options page");
- bbd.hIcon = (HANDLE)hIcon;
+ bbd.hIcon = hIcon;
bbd.dwButtonID = iNumber;
bbd.dwDefPos = 220;
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
}
- DestroyIcon(hIcon);
-
return 0;
}
diff --git a/plugins/Rate/main.cpp b/plugins/Rate/main.cpp
index d5a7fcbf71..d1f1b0f71f 100644
--- a/plugins/Rate/main.cpp
+++ b/plugins/Rate/main.cpp
@@ -173,20 +173,20 @@ int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
static void init_icolib (void)
{
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- sid.cbSize = SKINICONDESC_SIZE_V1;
- int i = 0;
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(sid);
sid.pszSection = Translate("Contact Rate");
- GetModuleFileNameA(g_hInst, szFile, MAX_PATH);
sid.pszDefaultFile = szFile;
+ sid.flags = SIDF_PATH_TCHAR;
- for ( i = 0; i < SIZEOF(iconList); i++ ) {
+ for (int i = 0; i < SIZEOF(iconList); i++ ) {
sid.pszName = iconList[i].szName;
- sid.ptszDescription = iconList[i].szDescr;
+ sid.pszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- iconList[i].hIconLibItem = (HANDLE) CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ iconList[i].hIconLibItem = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/SRMM/globals.c b/plugins/SRMM/globals.c
index 11e7606158..802bc9fccc 100644
--- a/plugins/SRMM/globals.c
+++ b/plugins/SRMM/globals.c
@@ -64,7 +64,7 @@ static void InitIcons(void)
mir_snprintf(szSettingName, sizeof(szSettingName), "SRMM_%s", iconList[i].szName);
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconLibItem[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/Scriver/globals.c b/plugins/Scriver/globals.c
index c1006bd8f7..d92ca958f4 100644
--- a/plugins/Scriver/globals.c
+++ b/plugins/Scriver/globals.c
@@ -171,7 +171,7 @@ void RegisterIcons(void)
sid.cx = sid.cy = iconList[i].size;
sid.iDefaultIndex = -iconList[i].defaultIndex;
sid.ptszDescription = (TCHAR*)iconList[i].description;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
}
diff --git a/plugins/SecureIM/loadicons.cpp b/plugins/SecureIM/loadicons.cpp
index ec6d0ae17e..3303424626 100644
--- a/plugins/SecureIM/loadicons.cpp
+++ b/plugins/SecureIM/loadicons.cpp
@@ -65,27 +65,21 @@ void InitIcons(void)
g_hIconInst = hNewIconInst;
- SKINICONDESC sid;
- memset(&sid,0,sizeof(sid));
-
- sid.cbSize = sizeof(SKINICONDESC);
+ SKINICONDESC sid = { 0 };
+ sid.cbSize = sizeof(sid);
sid.pszSection = "SecureIM";
HICON hIcon;
for (int i=0; icons[i].key; i++) {
- if(ServiceExists(MS_SKIN2_ADDICON)) {
- sid.pszSection = icons[i].section;
- sid.pszName = icons[i].name;
- sid.pszDescription = icons[i].text;
- sid.pszDefaultFile = "secureim_icons.dll";
- sid.iDefaultIndex = icons[i].key;
- sid.hDefaultIcon = (HICON)LoadImage(g_hIconInst, MAKEINTRESOURCE(icons[i].key), IMAGE_ICON, 16, 16, LR_SHARED);
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)icons[i].name);
- }
- else {
- hIcon = (HICON)LoadImage(g_hIconInst, MAKEINTRESOURCE(icons[i].key), IMAGE_ICON, 16, 16, LR_SHARED);
- }
+ sid.pszSection = icons[i].section;
+ sid.pszName = icons[i].name;
+ sid.pszDescription = icons[i].text;
+ sid.pszDefaultFile = "secureim_icons.dll";
+ sid.iDefaultIndex = icons[i].key;
+ sid.hDefaultIcon = (HICON)LoadImage(g_hIconInst, MAKEINTRESOURCE(icons[i].key), IMAGE_ICON, 16, 16, LR_SHARED);
+ Skin_AddIcon(&sid);
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)icons[i].name);
+
if(icons[i].tbl == TBL_IEC)
g_hIEC[icons[i].idx]=hIcon;
else
@@ -96,9 +90,7 @@ void InitIcons(void)
g_hPOP[icons[i].idx]=hIcon;
}
- if(ServiceExists(MS_SKIN2_ADDICON)) {
- AddHookFunction(ME_SKIN2_ICONSCHANGED, ReloadIcons);
- }
+ AddHookFunction(ME_SKIN2_ICONSCHANGED, ReloadIcons);
}
// EOF
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index a002af0f87..2e418dbb88 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -951,12 +951,11 @@ static int PluginInit(WPARAM wparam,LPARAM lparam)
hiSessionsSave = LoadIcon(hinstance, MAKEINTRESOURCE(IDD_SESSIONS_SAVE));
hiSessionsLoadLast = LoadIcon(hinstance, MAKEINTRESOURCE(IDD_SESSIONS_LOADLAST));
- hibChecked =(HANDLE)AddIcon(hiChecked, "SessionMarked", _T("Favorite Session"));
- hibNotChecked =(HANDLE)AddIcon(hiNotChecked, "SessionUnMarked", _T("Not favorite Session"));
-
- hibSessionsLoad =(HANDLE)AddIcon(hiSessionsLoad, "SessionsLoad", _T("Load Session"));
- hibSessionsSave =(HANDLE)AddIcon(hiSessionsSave, "SessionsSave", _T("Save Session"));
- hibSessionsLoadLast =(HANDLE)AddIcon(hiSessionsLoadLast, "SessionsLoadLast", _T("Load last Session"));
+ hibChecked = AddIcon(hiChecked, "SessionMarked", LPGENT("Favorite Session"));
+ hibNotChecked = AddIcon(hiNotChecked, "SessionUnMarked", LPGENT("Not favorite Session"));
+ hibSessionsLoad = AddIcon(hiSessionsLoad, "SessionsLoad", LPGENT("Load Session"));
+ hibSessionsSave = AddIcon(hiSessionsSave, "SessionsSave", LPGENT("Save Session"));
+ hibSessionsLoadLast = AddIcon(hiSessionsLoadLast, "SessionsLoadLast", LPGENT("Load last Session"));
CLISTMENUITEM cl;
ZeroMemory(&cl, sizeof(cl));
diff --git a/plugins/Sessions/Src/Utils.cpp b/plugins/Sessions/Src/Utils.cpp
index a4859e7874..26adc41513 100644
--- a/plugins/Sessions/Src/Utils.cpp
+++ b/plugins/Sessions/Src/Utils.cpp
@@ -535,7 +535,7 @@ BYTE IsMarkedUserDefSession(int ses_count)
return DBGetContactSettingByte(NULL, __INTERNAL_NAME, szSessionName, 0);
}
-int AddIcon(HICON icon, char *name, TCHAR *description)
+HANDLE AddIcon(HICON icon, char *name, TCHAR *description)
{
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
@@ -545,7 +545,7 @@ int AddIcon(HICON icon, char *name, TCHAR *description)
sid.ptszDescription = description;
sid.pszName = name;
sid.hDefaultIcon = icon;
- return CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ return Skin_AddIcon( &sid);
}
void SavePosition(HWND hwnd, char *wndName)
diff --git a/plugins/Sessions/Src/Utils.h b/plugins/Sessions/Src/Utils.h
index ce4fe75a59..f73dad00ad 100644
--- a/plugins/Sessions/Src/Utils.h
+++ b/plugins/Sessions/Src/Utils.h
@@ -33,7 +33,7 @@ int CheckForDuplicate(DWORD contact_list[],DWORD lparam);
BOOL ResaveSettings(char* szName,int iFirst,int iLimit,TCHAR* pszPrevSetting);
void OffsetWindow(HWND parent, HWND hwnd, int dx, int dy);
int LoadSessionToCombobox (HWND hdlg,BOOL mode,int iLimit,char* pszSetting,int iFirstNum);
-int AddIcon(HICON icon, char *name, TCHAR *description);
+HANDLE AddIcon(HICON icon, char *name, TCHAR *description);
int MarkUserDefSession(int ses_count,BYTE bCheck);
BYTE IsMarkedUserDefSession(int ses_count);
void SavePosition(HWND hWnd, char *wndName);
diff --git a/plugins/SimpleStatusMsg/utils.cpp b/plugins/SimpleStatusMsg/utils.cpp
index da2584cd22..549dd957bc 100644
--- a/plugins/SimpleStatusMsg/utils.cpp
+++ b/plugins/SimpleStatusMsg/utils.cpp
@@ -64,7 +64,7 @@ void IconsInit(void)
sid.pszName = szSettingName;
sid.ptszDescription = (TCHAR*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconLibItem[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/SmileyAdd/main.cpp b/plugins/SmileyAdd/main.cpp
index 92a7285a45..e647b694c2 100644
--- a/plugins/SmileyAdd/main.cpp
+++ b/plugins/SmileyAdd/main.cpp
@@ -64,7 +64,7 @@ static const PLUGININFOEX pluginInfoEx =
static SKINICONDESC skinDesc =
{
- SKINICONDESC_SIZE_V1, "SmileyAdd", NULL,
+ sizeof(SKINICONDESC), "SmileyAdd", NULL,
"SmileyAdd_ButtonSmiley", NULL, -IDI_SMILINGICON
};
@@ -88,7 +88,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
skinDesc.pszDefaultFile = path;
skinDesc.pszDescription = LPGEN("Button Smiley");
- HANDLE hSkinIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&skinDesc);
+ HANDLE hSkinIcon = Skin_AddIcon(&skinDesc);
INT_PTR temp = CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
metaProtoName = mir_strdup(temp == CALLSERVICE_NOTFOUND ? NULL : (char*)temp);
diff --git a/plugins/SpellChecker/spellchecker.cpp b/plugins/SpellChecker/spellchecker.cpp
index 09802db20e..d5ed23c822 100644
--- a/plugins/SpellChecker/spellchecker.cpp
+++ b/plugins/SpellChecker/spellchecker.cpp
@@ -262,7 +262,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
sid.ptszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
InitOptions();
@@ -318,7 +318,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
}
// Oki, lets add to IcoLib, then
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
if (hFlag != NULL)
DestroyIcon(hFlag);
diff --git a/plugins/Svc_crshdmp/crshdmp_icons.cpp b/plugins/Svc_crshdmp/crshdmp_icons.cpp
index 7b983bf0d0..1f7106303f 100644
--- a/plugins/Svc_crshdmp/crshdmp_icons.cpp
+++ b/plugins/Svc_crshdmp/crshdmp_icons.cpp
@@ -55,7 +55,7 @@ void InitIcons(void)
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIconLibItem[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIconLibItem[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/Svc_dbepp/headers.h b/plugins/Svc_dbepp/headers.h
index 97a530291c..57663f56e1 100644
--- a/plugins/Svc_dbepp/headers.h
+++ b/plugins/Svc_dbepp/headers.h
@@ -53,7 +53,6 @@
/////// icons support
-extern BYTE UsingIconManager;
void addIcons(TCHAR* szModuleFileName);
HICON LoadSkinnedDBEIcon(int icon);
int AddIconToList(HIMAGELIST hil, HICON hIcon);
diff --git a/plugins/Svc_dbepp/icons.cpp b/plugins/Svc_dbepp/icons.cpp
index f6ac36e95e..ae77539ae0 100644
--- a/plugins/Svc_dbepp/icons.cpp
+++ b/plugins/Svc_dbepp/icons.cpp
@@ -16,72 +16,64 @@ void addIcons(TCHAR* szModuleFileName)
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_KNOWN);
sid.pszName = name;
sid.iDefaultIndex = -ICO_KNOWN;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// open known module
sid.ptszDescription = LPGENT("Open Known Module");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_KNOWNOPEN);
sid.pszName = name;
sid.iDefaultIndex = -ICO_KNOWNOPEN;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// closed unknown module
sid.ptszDescription = LPGENT("Closed Unknown Module");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_UNKNOWN);
sid.pszName = name;
sid.iDefaultIndex = -ICO_UNKNOWN;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// open unknown module
sid.ptszDescription = LPGENT("Open Unknown Module");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_UNKNOWNOPEN);
sid.pszName = name;
sid.iDefaultIndex = -ICO_UNKNOWNOPEN;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// settings contact
sid.ptszDescription = LPGENT("Settings");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_SETTINGS);
sid.pszName = name;
sid.iDefaultIndex = -ICO_SETTINGS;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// contact group
sid.ptszDescription = LPGENT("Contacts Group");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_CONTACTS);
sid.pszName = name;
sid.iDefaultIndex = -ICO_CONTACTS;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// unknwon contact
sid.ptszDescription = LPGENT("Unknown Contact");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_OFFLINE);
sid.pszName = name;
sid.iDefaultIndex = -ICO_OFFLINE;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
// known contact
sid.ptszDescription = LPGENT("Known Contact");
mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_ONLINE);
sid.pszName = name;
sid.iDefaultIndex = -ICO_ONLINE;
- CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
HICON LoadSkinnedDBEIcon(int icon)
{
- HICON hIcon = 0;
- if (UsingIconManager)
- {
- char name[32];
- mir_snprintf(name, SIZEOF(name), "DBE++_%d", icon);
-
- hIcon = (HICON)CallService(MS_SKIN2_GETICON,0,(LPARAM)name);
- }
- if (!hIcon)
- return LoadIcon(hInst, MAKEINTRESOURCE(icon));
- else
- return hIcon;
+ char name[32];
+ mir_snprintf(name, SIZEOF(name), "DBE++_%d", icon);
+ HICON hIcon = (HICON)CallService(MS_SKIN2_GETICON,0,(LPARAM)name);
+ return (hIcon) ? hIcon : LoadIcon(hInst, MAKEINTRESOURCE(icon));
}
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp
index 0c7eec1a0f..c1507b3797 100644
--- a/plugins/Svc_dbepp/main.cpp
+++ b/plugins/Svc_dbepp/main.cpp
@@ -18,7 +18,6 @@ BYTE nameOrder[NAMEORDERCOUNT];
HANDLE hUserMenu;
HANDLE hRestore;
WatchListArrayStruct WatchListArray;
-BYTE UsingIconManager;
HANDLE sMenuCommand, sRegisterModule, sRegisterSingleModule, sImport, sServicemodeLaunch;
HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL, hTTBHook = NULL;
@@ -212,13 +211,8 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam)
doOldKnownModulesList(); // add the old plugins which havnt been changed over yet..
// icons
- if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH) && ServiceExists(MS_SKIN2_ADDICON))
- {
- UsingIconManager =1;
+ if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH))
addIcons(szModuleFileName);
- }
- else
- UsingIconManager = 0;
DBFreeVariant(&dbv);
UnhookEvent(hModulesLoadedHook);
diff --git a/plugins/TabSRMM/chat/options.cpp b/plugins/TabSRMM/chat/options.cpp
index 28f0362869..6a3da75c8d 100644
--- a/plugins/TabSRMM/chat/options.cpp
+++ b/plugins/TabSRMM/chat/options.cpp
@@ -426,71 +426,67 @@ static void LoadLogFonts(void)
LoadMsgDlgFont(FONTSECTION_CHAT, i, &aFonts[i].lf, &aFonts[i].color, CHAT_FONTMODULE);
}
-static struct _tagicons { char *szDesc; char *szName; int id; UINT size;} _icons[] = {
- LPGEN("Window Icon"), "chat_window", IDI_CHANMGR, 16,
- LPGEN("Icon overlay"), "chat_overlay", IDI_OVERLAY, 16,
-
- LPGEN("Status 1 (10x10)"), "chat_status0", IDI_STATUS0, 16,
- LPGEN("Status 2 (10x10)"), "chat_status1", IDI_STATUS1, 16,
- LPGEN("Status 3 (10x10)"), "chat_status2", IDI_STATUS2, 16,
- LPGEN("Status 4 (10x10)"), "chat_status3", IDI_STATUS3, 16,
- LPGEN("Status 5 (10x10)"), "chat_status4", IDI_STATUS4, 16,
- LPGEN("Status 6 (10x10)"), "chat_status5", IDI_STATUS5, 16,
- NULL, NULL, -1, 0
+struct { char *szDesc; char *szName; int id; UINT size;} static _icons[] =
+{
+ { LPGEN("Window Icon"), "chat_window", IDI_CHANMGR, 16 },
+ { LPGEN("Icon overlay"), "chat_overlay", IDI_OVERLAY, 16 },
+
+ { LPGEN("Status 1 (10x10)"), "chat_status0", IDI_STATUS0, 16 },
+ { LPGEN("Status 2 (10x10)"), "chat_status1", IDI_STATUS1, 16 },
+ { LPGEN("Status 3 (10x10)"), "chat_status2", IDI_STATUS2, 16 },
+ { LPGEN("Status 4 (10x10)"), "chat_status3", IDI_STATUS3, 16 },
+ { LPGEN("Status 5 (10x10)"), "chat_status4", IDI_STATUS4, 16 },
+ { LPGEN("Status 6 (10x10)"), "chat_status5", IDI_STATUS5, 16 },
};
-static struct _tag1icons { char *szDesc; char *szName; int id; UINT size;} _logicons[] = {
- LPGEN("Message in (10x10)"), "chat_log_message_in", IDI_MESSAGE, 16,
- LPGEN("Message out (10x10)"), "chat_log_message_out", IDI_MESSAGEOUT, 16,
- LPGEN("Action (10x10)"), "chat_log_action", IDI_ACTION, 16,
- LPGEN("Add Status (10x10)"), "chat_log_addstatus", IDI_ADDSTATUS, 16,
- LPGEN("Remove Status (10x10)"), "chat_log_removestatus", IDI_REMSTATUS, 16,
- LPGEN("Join (10x10)"), "chat_log_join", IDI_JOIN, 16,
- LPGEN("Leave (10x10)"), "chat_log_part", IDI_PART, 16,
- LPGEN("Quit (10x10)"), "chat_log_quit", IDI_QUIT, 16,
- LPGEN("Kick (10x10)"), "chat_log_kick", IDI_KICK, 16,
- LPGEN("Notice (10x10)"), "chat_log_notice", IDI_NOTICE, 16,
- LPGEN("Nickchange (10x10)"), "chat_log_nick", IDI_NICK, 16,
- LPGEN("Topic (10x10)"), "chat_log_topic", IDI_TOPIC, 16,
- LPGEN("Highlight (10x10)"), "chat_log_highlight", IDI_HIGHLIGHT, 16,
- LPGEN("Information (10x10)"), "chat_log_info", IDI_INFO, 16,
- NULL, NULL, 0, 0
+struct { char *szDesc; char *szName; int id; UINT size;} static _logicons[] =
+{
+ { LPGEN("Message in (10x10)"), "chat_log_message_in", IDI_MESSAGE, 16 },
+ { LPGEN("Message out (10x10)"), "chat_log_message_out", IDI_MESSAGEOUT, 16 },
+ { LPGEN("Action (10x10)"), "chat_log_action", IDI_ACTION, 16 },
+ { LPGEN("Add Status (10x10)"), "chat_log_addstatus", IDI_ADDSTATUS, 16 },
+ { LPGEN("Remove Status (10x10)"), "chat_log_removestatus", IDI_REMSTATUS, 16 },
+ { LPGEN("Join (10x10)"), "chat_log_join", IDI_JOIN, 16 },
+ { LPGEN("Leave (10x10)"), "chat_log_part", IDI_PART, 16 },
+ { LPGEN("Quit (10x10)"), "chat_log_quit", IDI_QUIT, 16 },
+ { LPGEN("Kick (10x10)"), "chat_log_kick", IDI_KICK, 16 },
+ { LPGEN("Notice (10x10)"), "chat_log_notice", IDI_NOTICE, 16 },
+ { LPGEN("Nickchange (10x10)"), "chat_log_nick", IDI_NICK, 16 },
+ { LPGEN("Topic (10x10)"), "chat_log_topic", IDI_TOPIC, 16 },
+ { LPGEN("Highlight (10x10)"), "chat_log_highlight", IDI_HIGHLIGHT, 16 },
+ { LPGEN("Information (10x10)"), "chat_log_info", IDI_INFO, 16 }
};
// add icons to the skinning module
void Chat_AddIcons(void)
{
- if (ServiceExists(MS_SKIN2_ADDICON)) {
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- int i = 0;
-
- // 16x16 icons
- sid.cbSize = sizeof(SKINICONDESC);
- sid.pszSection = TranslateA("TabSRMM/Group chat windows");
- GetModuleFileNameA(g_hIconDLL, szFile, MAX_PATH);
- sid.pszDefaultFile = szFile;
-
- while (_icons[i].szDesc != NULL) {
- sid.cx = sid.cy = _icons[i].size;
- sid.pszDescription = _icons[i].szDesc;
- sid.pszName = _icons[i].szName;
- sid.iDefaultIndex = -_icons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- i++;
- }
- i = 0;
- sid.pszSection = TranslateA("TabSRMM/Group chat log");
- while (_logicons[i].szDesc != NULL) {
- sid.cx = sid.cy = _logicons[i].size;
- sid.pszDescription = _logicons[i].szDesc;
- sid.pszName = _logicons[i].szName;
- sid.iDefaultIndex = -_logicons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- i++;
- }
+ int i;
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hIconDLL, szFile, SIZEOF(szFile));
+
+ // 16x16 icons
+ SKINICONDESC sid = {0};
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.pszSection = "TabSRMM/Group chat windows";
+ sid.ptszDefaultFile = szFile;
+ sid.flags = SIDF_PATH_TCHAR;
+
+ for (i=0; i < SIZEOF(_icons); i++) {
+ sid.cx = sid.cy = _icons[i].size;
+ sid.pszDescription = _icons[i].szDesc;
+ sid.pszName = _icons[i].szName;
+ sid.iDefaultIndex = -_icons[i].id;
+ Skin_AddIcon(&sid);
+ }
+
+ sid.pszSection = "TabSRMM/Group chat log";
+ for (i=0; i < SIZEOF(_logicons); i++) {
+ sid.cx = sid.cy = _logicons[i].size;
+ sid.pszDescription = _logicons[i].szDesc;
+ sid.pszName = _logicons[i].szName;
+ sid.iDefaultIndex = -_logicons[i].id;
+ Skin_AddIcon(&sid);
}
- return;
}
/*
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 214d65ac54..e1081ab5c3 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -1076,9 +1076,9 @@ static int TSAPI SetupIconLibConfig()
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)
- PluginConfig.g_buttonBarIconHandles[j++]=(HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ PluginConfig.g_buttonBarIconHandles[j++] = Skin_AddIcon(&sid);
else
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
}
n++;
}
@@ -1088,19 +1088,19 @@ static int TSAPI SetupIconLibConfig()
sid.pszName = "tabSRMM_clock_symbol";
sid.pszDescription = "Clock symbol (for the info panel clock)";
sid.iDefaultIndex = -IDI_CLOCK;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
strncpy(szFilename, "plugins\\tabsrmm.dll", MAX_PATH);
sid.pszName = "tabSRMM_overlay_disabled";
sid.pszDescription = "Feature disabled (used as overlay)";
sid.iDefaultIndex = -IDI_FEATURE_DISABLED;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
sid.pszName = "tabSRMM_overlay_enabled";
sid.pszDescription = "Feature enabled (used as overlay)";
sid.iDefaultIndex = -IDI_FEATURE_ENABLED;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
return 1;
diff --git a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
index b6f0e43207..e762b2a5a0 100644
--- a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
@@ -78,7 +78,7 @@ INT_PTR ServiceInvert(WPARAM wParam, LPARAM lParam)
int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- HICON hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL;
+ HANDLE hSwitchIcon = NULL, hTranslitIcon = NULL, hInvertIcon = NULL;
HOTKEYDESC hkd = {0};
hkd.cbSize = sizeof(hkd);
@@ -135,8 +135,7 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
Hotkey_Register(&hkd);
hOnButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, OnButtonPressed);
- if (ServiceExists(MS_BB_ADDBUTTON) && ServiceExists(MS_SKIN2_ADDICON))
- {
+ if (ServiceExists(MS_BB_ADDBUTTON)) {
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.flags = SIDF_TCHAR;
@@ -145,27 +144,18 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
sid.ptszDescription = _T("SwitchLayout and Send");
sid.pszName = "SwitchLayout and Send";
sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND));
- hSwitchIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ hSwitchIcon = Skin_AddIcon(&sid);
sid.ptszDescription = _T("Translit and Send");
sid.pszName = "Translit and Send";
sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND));
- hTranslitIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ hTranslitIcon = Skin_AddIcon(&sid);
sid.ptszDescription = _T("Invert Case and Send");
sid.pszName = "Invert Case and Send";
sid.hDefaultIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND));
- hInvertIcon = (HICON)CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
- }
- else if (ServiceExists(MS_BB_ADDBUTTON))
- {
- hSwitchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_SWITCHSEND));
- hTranslitIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TRANSLITSEND));
- hInvertIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_INVERTSEND));
- }
+ hInvertIcon = Skin_AddIcon(&sid);
- if (ServiceExists(MS_BB_ADDBUTTON))
- {
BBButton bbd = {0};
bbd.cbSize = sizeof(BBButton);
bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON;
@@ -190,11 +180,6 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
bbd.dwDefPos = 50;
CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&bbd);
}
-
- DestroyIcon(hSwitchIcon);
- DestroyIcon(hTranslitIcon);
- DestroyIcon(hInvertIcon);
-
return 0;
}
diff --git a/plugins/Updater/icons.cpp b/plugins/Updater/icons.cpp
index 1123294676..03a76a1939 100644
--- a/plugins/Updater/icons.cpp
+++ b/plugins/Updater/icons.cpp
@@ -51,6 +51,6 @@ void InitIcons(void)
sid.pszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
- hIcolibIcon[i] = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
+ hIcolibIcon[i] = Skin_AddIcon(&sid);
}
}
diff --git a/plugins/UserInfoEx/classPsTreeItem.cpp b/plugins/UserInfoEx/classPsTreeItem.cpp
index 7f32b4871a..4f8b641691 100644
--- a/plugins/UserInfoEx/classPsTreeItem.cpp
+++ b/plugins/UserInfoEx/classPsTreeItem.cpp
@@ -412,12 +412,10 @@ INT CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BOOLEAN bInitIcon
if (!sid.hDefaultIcon) sid.hDefaultIcon = ImageList_GetIcon(hIml, 0, ILD_NORMAL);
}
// add file to icolib
- CallServiceSync(MS_SKIN2_ADDICON, NULL, (LPARAM)&sid);
+ Skin_AddIcon(&sid);
if (!bInitIconsOnly)
- {
hIcon = IcoLib_GetIcon(pszIconName);
- }
}
if (!bInitIconsOnly && hIml) {
diff --git a/plugins/Variables/variables.cpp b/plugins/Variables/variables.cpp
index 5f81c35eb3..26190fb779 100644
--- a/plugins/Variables/variables.cpp
+++ b/plugins/Variables/variables.cpp
@@ -592,23 +592,23 @@ int LoadVarModule() {
}
hShowHelpService = CreateServiceFunction(MS_VARS_SHOWHELP, showHelpService);
hShowHelpExService = CreateServiceFunction(MS_VARS_SHOWHELPEX, showHelpExService);
- if (ServiceExists(MS_SKIN2_ADDICON)) {
- SKINICONDESC sid;
- char szFile[MAX_PATH];
-
- ZeroMemory(&sid, sizeof(SKINICONDESC));
- sid.cbSize = sizeof(SKINICONDESC);
- sid.ptszSection = TranslateT("Variables");
- sid.ptszDescription = TranslateT("Help");
- sid.pszName = "vars_help";
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
- sid.pszDefaultFile = szFile;
- sid.iDefaultIndex = -IDI_V;
- sid.cx = sid.cy = 16;
- sid.flags = SIDF_TCHAR;
- CallService(MS_SKIN2_ADDICON, (WPARAM)0, (LPARAM)&sid);
- hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, iconsChanged);
- }
+
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInst, szFile, MAX_PATH);
+
+ SKINICONDESC sid = { 0 };
+ sid.cbSize = sizeof(SKINICONDESC);
+ sid.ptszSection = TranslateT("Variables");
+ sid.ptszDescription = TranslateT("Help");
+ sid.pszName = "vars_help";
+ sid.ptszDefaultFile = szFile;
+ sid.iDefaultIndex = -IDI_V;
+ sid.cx = sid.cy = 16;
+ sid.flags = SIDF_ALL_TCHAR;
+ Skin_AddIcon(&sid);
+
+ hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, iconsChanged);
+
hGetIconService = CreateServiceFunction(MS_VARS_GETSKINITEM, getSkinItemService);
hOptionsHook = HookEvent(ME_OPT_INITIALISE, OptionsInit);
diff --git a/plugins/WhenWasIt/icons.cpp b/plugins/WhenWasIt/icons.cpp
index facb02b574..805593ade4 100644
--- a/plugins/WhenWasIt/icons.cpp
+++ b/plugins/WhenWasIt/icons.cpp
@@ -75,46 +75,40 @@ int LoadIcons()
return 0;
}
-int AddIcon(HICON icon, char *name, char *description)
+HANDLE AddIcon(HICON icon, char *name, char *description)
{
SKINICONDESC sid = {0};
- sid.cbSize = sizeof(SKINICONDESC);
+ sid.cbSize = sizeof(sid);
sid.pszSection = "WhenWasIt";
sid.cx = sid.cy = 16;
sid.pszDescription = description;
sid.pszName = name;
sid.hDefaultIcon = icon;
-
- return CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid);
+ return Skin_AddIcon(&sid);
}
int AddIcons()
{
- if (ServiceExists(MS_SKIN2_ADDICON)) //if icolib is installed
- {
-// AddIcon(hiDlgIcon, "Dlg", "Popup and dialog ");
- AddIcon(hiCheckMenu, "MenuCheck", "Check birthdays menu item");
- AddIcon(hiListMenu, "MenuList", "List birthdays menu item");
- AddIcon(hiAddBirthdayContact, "AddBirthday", "Add/change birthday");
- AddIcon(hiRefreshUserDetails, "RefreshUserDetails", "Refresh user details");
-
- AddIcon(hiImportBirthdays, "ImportBirthdays", "Import birthdays");
- AddIcon(hiExportBirthdays, "ExportBirthdays", "Export birthdays");
-
- int i;
- char name[1024];
- char description[1024];
- AddIcon(hiDTB[0], "DTB0", "Birthday today");
- AddIcon(hiDTB[1], "DTB1", "1 day to birthday");
- for (i = 2; i < cDTB; i++)
- {
- sprintf(name, "DTB%d", i);
- sprintf(description, "%d days to birthday", i);
- AddIcon(hiDTB[i], name, description);
- }
- sprintf(description, "More than %d days to birthday", cDTB - 1);
- AddIcon(hiDTBMore, "DTBMore", description);
- }
+ AddIcon(hiCheckMenu, "MenuCheck", "Check birthdays menu item");
+ AddIcon(hiListMenu, "MenuList", "List birthdays menu item");
+ AddIcon(hiAddBirthdayContact, "AddBirthday", "Add/change birthday");
+ AddIcon(hiRefreshUserDetails, "RefreshUserDetails", "Refresh user details");
+
+ AddIcon(hiImportBirthdays, "ImportBirthdays", "Import birthdays");
+ AddIcon(hiExportBirthdays, "ExportBirthdays", "Export birthdays");
+
+ int i;
+ char name[1024];
+ char description[1024];
+ AddIcon(hiDTB[0], "DTB0", "Birthday today");
+ AddIcon(hiDTB[1], "DTB1", "1 day to birthday");
+ for (i = 2; i < cDTB; i++) {
+ sprintf(name, "DTB%d", i);
+ sprintf(description, "%d days to birthday", i);
+ AddIcon(hiDTB[i], name, description);
+ }
+ sprintf(description, "More than %d days to birthday", cDTB - 1);
+ AddIcon(hiDTBMore, "DTBMore", description);
return 0;
}