summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_lists.cpp23
-rw-r--r--protocols/MSN/src/msn_menu.cpp12
-rw-r--r--protocols/MSN/src/msn_misc.cpp2
-rw-r--r--protocols/MSN/src/msn_opts.cpp27
-rw-r--r--protocols/MSN/src/stdafx.h4
5 files changed, 19 insertions, 49 deletions
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index c91e7d68ab..841ad32122 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -471,28 +471,25 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 5, 5);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = LoadIconEx("list_lc");
+ HICON hIcon = g_plugin.getIcon(IDI_LIST_LC);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_LC, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_fl");
+ hIcon = g_plugin.getIcon(IDI_LIST_FL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_FL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_al");
+ hIcon = g_plugin.getIcon(IDI_LIST_AL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_AL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_bl");
+ hIcon = g_plugin.getIcon(IDI_LIST_BL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_BL, STM_SETICON, (WPARAM)hIcon, 0);
- hIcon = LoadIconEx("list_rl");
+ hIcon = g_plugin.getIcon(IDI_LIST_RL);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_RL, STM_SETICON, (WPARAM)hIcon, 0);
@@ -568,10 +565,10 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_DESTROY:
HIMAGELIST hIml = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETEXTRAIMAGELIST, 0, 0);
ImageList_Destroy(hIml);
- ReleaseIconEx("list_fl");
- ReleaseIconEx("list_al");
- ReleaseIconEx("list_bl");
- ReleaseIconEx("list_rl");
+ g_plugin.releaseIcon(IDI_LIST_FL);
+ g_plugin.releaseIcon(IDI_LIST_AL);
+ g_plugin.releaseIcon(IDI_LIST_BL);
+ g_plugin.releaseIcon(IDI_LIST_RL);
break;
}
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index 70c00d637f..fb55661a93 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -147,28 +147,28 @@ void CMsnProto::OnBuildProtoMenu(void)
mi.pszService = MSN_INVITE;
CreateProtoService(mi.pszService, &CMsnProto::MsnInviteCommand);
mi.position = 201002;
- mi.hIcolibItem = GetIconHandle(IDI_INVITE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_INVITE);
mi.name.a = LPGEN("Create &Chat");
menuItemsMain[0] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_GOTO_INBOX;
CreateProtoService(mi.pszService, &CMsnProto::MsnGotoInbox);
mi.position = 201003;
- mi.hIcolibItem = GetIconHandle(IDI_INBOX);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_INBOX);
mi.name.a = LPGEN("Display &Hotmail Inbox");
menuItemsMain[1] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_EDIT_PROFILE;
CreateProtoService(mi.pszService, &CMsnProto::MsnEditProfile);
mi.position = 201004;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("View &Profile");
menuItemsMain[2] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = MS_EDIT_ALERTS;
CreateProtoService(mi.pszService, &CMsnProto::MsnSetupAlerts);
mi.position = 201004;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("Setup Live &Alerts");
menuItemsMain[3] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
@@ -232,7 +232,7 @@ void MSN_InitContactMenu(void)
mir_strcpy(tDest, MSN_BLOCK);
CreateServiceFunction(servicefunction, MsnMenuBlockCommand);
mi.position = -500050000;
- mi.hIcolibItem = GetIconHandle(IDI_MSNBLOCK);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_MSNBLOCK);
mi.name.a = LPGEN("&Block");
hBlockMenuItem = Menu_AddContactMenuItem(&mi);
@@ -240,7 +240,7 @@ void MSN_InitContactMenu(void)
mir_strcpy(tDest, MSN_VIEW_PROFILE);
CreateServiceFunction(servicefunction, MsnMenuViewProfile);
mi.position = -500050003;
- mi.hIcolibItem = GetIconHandle(IDI_PROFILE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PROFILE);
mi.name.a = LPGEN("View &Profile");
hLiveSpaceMenuItem = Menu_AddContactMenuItem(&mi);
diff --git a/protocols/MSN/src/msn_misc.cpp b/protocols/MSN/src/msn_misc.cpp
index 8d62b4984d..03f595147f 100644
--- a/protocols/MSN/src/msn_misc.cpp
+++ b/protocols/MSN/src/msn_misc.cpp
@@ -795,7 +795,7 @@ void CMsnProto::InitPopups(void)
POPUPCLASS ppc = { sizeof(ppc) };
ppc.flags = PCF_UNICODE;
ppc.PluginWindowProc = NullWindowProc;
- ppc.hIcon = LoadIconEx("main");
+ ppc.hIcon = g_plugin.getIcon(IDI_MSN);
ppc.pszName = name;
ppc.pszDescription.w = desc;
diff --git a/protocols/MSN/src/msn_opts.cpp b/protocols/MSN/src/msn_opts.cpp
index d348961550..7ee0dfca33 100644
--- a/protocols/MSN/src/msn_opts.cpp
+++ b/protocols/MSN/src/msn_opts.cpp
@@ -50,31 +50,6 @@ void MsnInitIcons(void)
g_plugin.registerIcon("Protocols/MSN", iconList, "MSN");
}
-HICON LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "MSN_%s", name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
-HANDLE GetIconHandle(int iconId)
-{
- for (auto &it : iconList)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-}
-
-void ReleaseIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "MSN_%s", name);
- IcoLib_Release(szSettingName, big);
-}
-
-INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
/////////////////////////////////////////////////////////////////////////////////////////
// MSN Options dialog procedure
@@ -589,6 +564,8 @@ INT_PTR CALLBACK DlgDeleteContactUI(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
/////////////////////////////////////////////////////////////////////////////////////////
// Initialize options pages
+INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+
int CMsnProto::OnOptionsInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = {};
diff --git a/protocols/MSN/src/stdafx.h b/protocols/MSN/src/stdafx.h
index e4b3b8e4fc..9340fe47c1 100644
--- a/protocols/MSN/src/stdafx.h
+++ b/protocols/MSN/src/stdafx.h
@@ -225,10 +225,6 @@ unsigned MSN_GenRandom(void);
void MSN_InitContactMenu(void);
void MSN_RemoveContactMenus(void);
-HANDLE GetIconHandle(int iconId);
-HICON LoadIconEx(const char* name, bool big = false);
-void ReleaseIconEx(const char* name, bool big = false);
-
void MsnInitIcons(void);
int sttDivideWords(char* parBuffer, int parMinItems, char** parDest);