summaryrefslogtreecommitdiff
path: root/plugins/Popup/src
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup/src')
-rw-r--r--plugins/Popup/src/actions.cpp18
-rw-r--r--plugins/Popup/src/history.cpp2
-rw-r--r--plugins/Popup/src/icons.cpp40
-rw-r--r--plugins/Popup/src/icons.h37
-rw-r--r--plugins/Popup/src/main.cpp4
-rw-r--r--plugins/Popup/src/notifications.cpp6
-rw-r--r--plugins/Popup/src/opt_adv.cpp2
-rw-r--r--plugins/Popup/src/opt_class.cpp4
-rw-r--r--plugins/Popup/src/opt_contacts.cpp18
-rw-r--r--plugins/Popup/src/opt_gen.cpp6
-rw-r--r--plugins/Popup/src/opt_skins.cpp2
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp18
-rw-r--r--plugins/Popup/src/services.cpp6
-rw-r--r--plugins/Popup/src/srmm_menu.cpp4
-rw-r--r--plugins/Popup/src/stdafx.h3
15 files changed, 50 insertions, 120 deletions
diff --git a/plugins/Popup/src/actions.cpp b/plugins/Popup/src/actions.cpp
index 867e4d48bf..8b5d58d027 100644
--- a/plugins/Popup/src/actions.cpp
+++ b/plugins/Popup/src/actions.cpp
@@ -35,14 +35,14 @@ void LoadActions()
{
POPUPACTION actions[] =
{
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_REPLY), LPGEN("General") "/" LPGEN("Quick reply"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_MESSAGE), LPGEN("General") "/" LPGEN("Send message"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_INFO), LPGEN("General") "/" LPGEN("User details"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_MENU), LPGEN("General") "/" LPGEN("Contact menu"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_ADD), LPGEN("General") "/" LPGEN("Add permanently"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_PIN), LPGEN("General") "/" LPGEN("Pin popup"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_CLOSE), LPGEN("General") "/" LPGEN("Dismiss popup"), 0 },
- { sizeof(POPUPACTION), LoadIconEx(IDI_ACT_COPY), LPGEN("General") "/" LPGEN("Copy to clipboard"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_REPLY), LPGEN("General") "/" LPGEN("Quick reply"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_MESSAGE), LPGEN("General") "/" LPGEN("Send message"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_INFO), LPGEN("General") "/" LPGEN("User details"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_MENU), LPGEN("General") "/" LPGEN("Contact menu"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_ADD), LPGEN("General") "/" LPGEN("Add permanently"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_PIN), LPGEN("General") "/" LPGEN("Pin popup"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_CLOSE), LPGEN("General") "/" LPGEN("Dismiss popup"), 0 },
+ { sizeof(POPUPACTION), g_plugin.getIcon(IDI_ACT_COPY), LPGEN("General") "/" LPGEN("Copy to clipboard"), 0 },
};
for (auto &it : actions)
@@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcPopupActions(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwnd);
- SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)LoadIconEx(IDI_MB_INFO), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_MB_INFO), 0);
CheckDlgButton(hwnd, IDC_CHK_ENABLEACTIONS, PopupOptions.actions & ACT_ENABLE ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwnd, IDC_CHK_IMCONTACTSONLY, PopupOptions.actions & ACT_DEF_IMONLY ? BST_CHECKED : BST_UNCHECKED);
diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp
index dd9f6afa62..db4f52baa2 100644
--- a/plugins/Popup/src/history.cpp
+++ b/plugins/Popup/src/history.cpp
@@ -132,7 +132,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara
ListBox_SetItemData(hwndList, ListBox_AddString(hwndList, L""), 0);
}
- Window_SetIcon_IcoLib(hwnd, GetIconHandle(IDI_HISTORY));
+ Window_SetIcon_IcoLib(hwnd, g_plugin.getIconHandle(IDI_HISTORY));
if (gbHppInstalled && PopupOptions.UseHppHistoryLog) {
logType = LOG_HPP;
diff --git a/plugins/Popup/src/icons.cpp b/plugins/Popup/src/icons.cpp
index 083593ac11..7e0df28a29 100644
--- a/plugins/Popup/src/icons.cpp
+++ b/plugins/Popup/src/icons.cpp
@@ -66,41 +66,7 @@ static IconItem iconList3[] =
void InitIcons()
{
- g_plugin.registerIcon(SECT_POPUP, iconList1, MODULENAME);
- g_plugin.registerIcon(SECT_POPUP SECT_POPUP_OPT, iconList2, MODULENAME);
- g_plugin.registerIcon(SECT_POPUP SECT_POPUP_ACT, iconList3, MODULENAME);
-}
-
-HICON LoadIconEx(int iconId, bool big)
-{
- for (auto &it : iconList1)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
-
- for (auto &it : iconList2)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
-
- for (auto &it : iconList3)
- if (it.defIconID == iconId)
- return IcoLib_GetIconByHandle(it.hIcolib, big);
-
- return nullptr;
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList1)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : iconList2)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : iconList3)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
+ g_plugin.registerIcon(MODULNAME_PLU, iconList1, MODULENAME);
+ g_plugin.registerIcon(MODULNAME_PLU "/Options", iconList2, MODULENAME);
+ g_plugin.registerIcon(MODULNAME_PLU "/Actions", iconList3, MODULENAME);
}
diff --git a/plugins/Popup/src/icons.h b/plugins/Popup/src/icons.h
deleted file mode 100644
index ad7ee64153..0000000000
--- a/plugins/Popup/src/icons.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Popup Plus plugin for Miranda IM
-
-Copyright © 2002 Luca Santarelli,
-© 2004-2007 Victor Pavlychko
-© 2010 MPK
-© 2010 Merlin_de
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#ifndef __icons_h__
-#define __icons_h__
-
-//ICONS
-#define SECT_POPUP MODULNAME_PLU
-#define SECT_POPUP_ACT "/Actions"
-#define SECT_POPUP_OPT "/Options"
-#define SECT_POPUP_MISC "/Misc"
-
-void InitIcons();
-HICON LoadIconEx(int iconId, bool big = false);
-HANDLE GetIconHandle(int iconid);
-
-#endif // __icons_h__
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 7dbf9a39fb..05923e9312 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -114,7 +114,7 @@ static int IconsChanged(WPARAM, LPARAM)
Menu_ModifyItem(hMenuItem, nullptr, hIcon);
Menu_ModifyItem(hMenuRoot, nullptr, hIcon);
- Menu_ModifyItem(hMenuItemHistory, nullptr, GetIconHandle(IDI_HISTORY));
+ Menu_ModifyItem(hMenuItemHistory, nullptr, g_plugin.getIconHandle(IDI_HISTORY));
return 0;
}
@@ -191,7 +191,7 @@ void InitMenuItems(void)
CreateServiceFunction(mi.pszService, svcShowHistory);
mi.position = 1000000000;
mi.name.w = LPGENW("Popup history");
- mi.hIcolibItem = GetIconHandle(IDI_HISTORY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_HISTORY);
hMenuItemHistory = Menu_AddMainMenuItem(&mi);
}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp
index 48dc3c4f5c..c6a507893a 100644
--- a/plugins/Popup/src/notifications.cpp
+++ b/plugins/Popup/src/notifications.cpp
@@ -46,7 +46,7 @@ void LoadNotifications()
mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
mir_strncpy(notification.lpzName, "Warning", sizeof(notification.lpzName));
- notification.lchIcoLib = GetIconHandle(IDI_MB_WARN);
+ notification.lchIcoLib = g_plugin.getIconHandle(IDI_MB_WARN);
notification.colorBack = RGB(210, 210, 150);
notification.colorText = RGB(0, 0, 0);
notification.iSeconds = 10;
@@ -54,7 +54,7 @@ void LoadNotifications()
mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
mir_strncpy(notification.lpzName, "Notification", sizeof(notification.lpzName));
- notification.lchIcoLib = GetIconHandle(IDI_MB_INFO);
+ notification.lchIcoLib = g_plugin.getIconHandle(IDI_MB_INFO);
notification.colorBack = RGB(230, 230, 230);
notification.colorText = RGB(0, 0, 0);
notification.iSeconds = 7;
@@ -62,7 +62,7 @@ void LoadNotifications()
mir_strncpy(notification.lpzGroup, "Misc", sizeof(notification.lpzName));
mir_strncpy(notification.lpzName, "Error", sizeof(notification.lpzName));
- notification.lchIcoLib = GetIconHandle(IDI_MB_STOP);
+ notification.lchIcoLib = g_plugin.getIconHandle(IDI_MB_STOP);
notification.colorBack = RGB(191, 0, 0);
notification.colorText = RGB(255, 245, 225);
notification.iSeconds = -1;
diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp
index 04dfe50948..a6bb89eacd 100644
--- a/plugins/Popup/src/opt_adv.cpp
+++ b/plugins/Popup/src/opt_adv.cpp
@@ -112,7 +112,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HWND hCtrl = GetDlgItem(hwnd, IDC_SHOWHISTORY);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)Translate("Popup history"), 0);
- SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_HISTORY));
+ SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_HISTORY));
EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory);
EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory);
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index f68cca8e11..d2eb116c6e 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -178,7 +178,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
TreeView_DeleteAllItems(hwndTree);
// Treeview create image list
HIMAGELIST hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, num_classes + 1);
- ImageList_ReplaceIcon(hImgLst, -1, LoadIconEx(IDI_OPT_GROUP));
+ ImageList_ReplaceIcon(hImgLst, -1, g_plugin.getIcon(IDI_OPT_GROUP));
TreeView_SetImageList(hwndTree, hImgLst, TVSIL_NORMAL);
for (auto &p : gTreeData) {
@@ -218,7 +218,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
(WPARAM)Translate(it.title), 0);
}
// info icon
- SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)LoadIconEx(IDI_MB_INFO), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_INFO, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_MB_INFO), 0);
// more button
EnableWindow(GetDlgItem(hwnd, IDC_MORE), FALSE);
// preview button
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp
index af65fe46f5..55b17d1655 100644
--- a/plugins/Popup/src/opt_contacts.cpp
+++ b/plugins/Popup/src/opt_contacts.cpp
@@ -46,17 +46,17 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
case WM_INITDIALOG:
TranslateDialogDefault(hwnd);
- SendDlgItemMessage(hwnd, IDC_ICO_AUTO, STM_SETICON, (WPARAM)LoadIconEx(IDI_ACT_OK), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_FAVORITE, STM_SETICON, (WPARAM)LoadIconEx(IDI_OPT_FAVORITE), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_FULLSCREEN, STM_SETICON, (WPARAM)LoadIconEx(IDI_OPT_FULLSCREEN), 0);
- SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)LoadIconEx(IDI_OPT_BLOCK), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_AUTO, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_ACT_OK), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_FAVORITE, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_OPT_FAVORITE), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_FULLSCREEN, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_OPT_FULLSCREEN), 0);
+ SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_OPT_BLOCK), 0);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5);
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, LoadIconEx(IDI_ACT_OK));
- ImageList_AddIcon(hIml, LoadIconEx(IDI_OPT_FAVORITE));
- ImageList_AddIcon(hIml, LoadIconEx(IDI_OPT_FULLSCREEN));
- ImageList_AddIcon(hIml, LoadIconEx(IDI_OPT_BLOCK));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ g_plugin.addImgListIcon(hIml, IDI_ACT_OK);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FAVORITE);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FULLSCREEN);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_BLOCK);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*_countof(sttIcons)*/, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp
index ebe0c4d6e0..6503332b2c 100644
--- a/plugins/Popup/src/opt_gen.cpp
+++ b/plugins/Popup/src/opt_gen.cpp
@@ -181,7 +181,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HWND hCtrl = GetDlgItem(hwnd, IDC_CUSTOMPOS);
SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0);
SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)L"Popup area", BATF_UNICODE);
- SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_RESIZE));
+ SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_RESIZE));
}
// Spreading combobox
{
@@ -623,11 +623,11 @@ INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDOK, BUTTONADDTOOLTIP, (WPARAM)L"OK", BATF_UNICODE);
- SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_ACT_OK));
+ SendDlgItemMessage(hwndDlg, IDOK, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_ACT_OK));
SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDCANCEL, BUTTONADDTOOLTIP, (WPARAM)L"Cancel", BATF_UNICODE);
- SendDlgItemMessage(hwndDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_ACT_CLOSE));
+ SendDlgItemMessage(hwndDlg, IDCANCEL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_ACT_CLOSE));
SetDlgItemInt(hwndDlg, IDC_TXT_TOP, PopupOptions.gapTop, FALSE);
SetDlgItemInt(hwndDlg, IDC_TXT_BOTTOM, PopupOptions.gapBottom, FALSE);
diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp
index 458cf19f6a..43267d16b4 100644
--- a/plugins/Popup/src/opt_skins.cpp
+++ b/plugins/Popup/src/opt_skins.cpp
@@ -348,7 +348,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
// Skin List reload button
SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)LoadIconEx(IDI_RELOAD));
+ SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_RELOAD));
SendDlgItemMessage(hwndDlg, IDC_BTN_RELOAD, BUTTONADDTOOLTIP, (WPARAM)Translate("Refresh List"), 0);
// Skin Option List
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index 1f7fa7b44c..16c0c2c5de 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -544,7 +544,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && isIm && IsActionEnabled("General/Quick reply")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_REPLY, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_REPLY, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Quick reply");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_REPLY;
@@ -553,7 +553,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && isIm && IsActionEnabled("General/Send message")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_MESSAGE, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_MESSAGE, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Send message");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_MESSAGE;
@@ -562,7 +562,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && IsActionEnabled("General/User details")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_INFO, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_INFO, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/User details");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_DETAILS;
@@ -571,7 +571,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && IsActionEnabled("General/Contact menu")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_MENU, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_MENU, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Contact menu");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_MENU;
@@ -580,7 +580,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultUsr && db_get_b(m_hContact, "CList", "NotOnList", 0) && IsActionEnabled("General/Add permanently")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_ADD, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_ADD, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Add permanently");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_ADD;
@@ -589,7 +589,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && (m_iTimeout != -1) && IsActionEnabled("General/Pin popup")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = m_bIsPinned ? LoadIconEx(IDI_ACT_PINNED, iconSize) : LoadIconEx(IDI_ACT_PIN, iconSize);
+ m_actions[iAction].actionA.lchIcon = m_bIsPinned ? g_plugin.getIcon(IDI_ACT_PINNED, iconSize) : g_plugin.getIcon(IDI_ACT_PIN, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Pin popup");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_PIN;
@@ -598,7 +598,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && IsActionEnabled("General/Dismiss popup")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_CLOSE, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_CLOSE, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Dismiss popup");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_DISMISS;
@@ -607,7 +607,7 @@ int PopupWnd2::fixActions(POPUPACTION *theActions, int count)
if (enableDefaultGen && IsActionEnabled("General/Copy to clipboard")) {
m_actions[iAction].actionA.cbSize = sizeof(POPUPACTION);
- m_actions[iAction].actionA.lchIcon = LoadIconEx(IDI_ACT_COPY, iconSize);
+ m_actions[iAction].actionA.lchIcon = g_plugin.getIcon(IDI_ACT_COPY, iconSize);
mir_strcpy(m_actions[iAction].actionA.lpzTitle, "General/Copy to clipboard");
m_actions[iAction].actionA.wParam = 0;
m_actions[iAction].actionA.lParam = ACT_DEF_COPY;
@@ -941,7 +941,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
m_bIsPinned = !m_bIsPinned;
{
bool iconSize = PopupOptions.actions & ACT_LARGE ? TRUE : FALSE;
- PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? LoadIconEx(IDI_ACT_PINNED, iconSize) : LoadIconEx(IDI_ACT_PIN, iconSize));
+ PUModifyActionIcon(m_hwnd, wParam, lParam, m_bIsPinned ? g_plugin.getIcon(IDI_ACT_PINNED, iconSize) : g_plugin.getIcon(IDI_ACT_PIN, iconSize));
}
break;
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 9a87bbcf81..cafe1a5093 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -237,21 +237,21 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam)
ppd2.szText.w = (wchar_t*)wParam;
switch (lParam & 0x7fffffff) {
case SM_ERROR:
- ppd2.lchIcon = LoadIconEx(IDI_MB_STOP, 0);
+ ppd2.lchIcon = g_plugin.getIcon(IDI_MB_STOP, 0);
ppd2.colorBack = RGB(191, 0, 0);
ppd2.colorText = RGB(255, 245, 225);
ppd2.lchNotification = g_hntfError;
ppd2.szTitle.w = TranslateT("Error");
break;
case SM_WARNING:
- ppd2.lchIcon = LoadIconEx(IDI_MB_WARN, 0);
+ ppd2.lchIcon = g_plugin.getIcon(IDI_MB_WARN, 0);
ppd2.colorBack = RGB(210, 210, 150);
ppd2.colorText = RGB(0, 0, 0);
ppd2.lchNotification = g_hntfWarning;
ppd2.szTitle.w = TranslateT("Warning");
break;
case SM_NOTIFY:
- ppd2.lchIcon = LoadIconEx(IDI_MB_INFO, 0);
+ ppd2.lchIcon = g_plugin.getIcon(IDI_MB_INFO, 0);
ppd2.colorBack = RGB(230, 230, 230);
ppd2.colorText = RGB(0, 0, 0);
ppd2.lchNotification = g_hntfNotification;
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index 885bb4fa38..cf52439b79 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -108,12 +108,12 @@ void SrmmMenu_Load()
sid.dwId = 1;
sid.szTooltip.a = LPGEN("Popup Mode: Favorite");
- sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FAVORITE);
+ sid.hIcon = sid.hIconDisabled = g_plugin.getIcon(IDI_OPT_FAVORITE);
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 2;
sid.szTooltip.a = LPGEN("Popup Mode: Ignore fullscreen");
- sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FULLSCREEN);
+ sid.hIcon = sid.hIconDisabled = g_plugin.getIcon(IDI_OPT_FULLSCREEN);
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 3;
diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h
index d91eb951ec..f463dd9f86 100644
--- a/plugins/Popup/src/stdafx.h
+++ b/plugins/Popup/src/stdafx.h
@@ -123,7 +123,6 @@ struct CMPlugin : public PLUGIN<CMPlugin>
#include "services.h"
#include "srmm_menu.h"
#include "bitmap_funcs.h"
-#include "icons.h"
#include "font.h"
#include "formula.h"
#include "skin.h"
@@ -141,4 +140,6 @@ struct CMPlugin : public PLUGIN<CMPlugin>
INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM);
+void InitIcons();
+
#endif //HEADERS_H