summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/theme.cpp22
-rw-r--r--protocols/AimOscar/src/theme.h2
-rwxr-xr-xprotocols/AimOscar/src/ui.cpp9
-rw-r--r--protocols/Dummy/src/dummy_options.cpp6
-rw-r--r--protocols/FacebookRM/src/captcha.cpp6
-rw-r--r--protocols/FacebookRM/src/dialogs.cpp5
-rw-r--r--protocols/Gadu-Gadu/src/gg.h2
-rw-r--r--protocols/Gadu-Gadu/src/groupchat.cpp7
-rw-r--r--protocols/Gadu-Gadu/src/icolib.cpp12
-rw-r--r--protocols/Gadu-Gadu/src/image.cpp6
-rw-r--r--protocols/Gadu-Gadu/src/sessions.cpp4
-rw-r--r--protocols/Gadu-Gadu/src/userutils.cpp4
-rw-r--r--protocols/IRCG/src/ircproto.cpp2
-rw-r--r--protocols/IRCG/src/options.cpp18
-rw-r--r--protocols/IRCG/src/services.cpp2
-rw-r--r--protocols/IRCG/src/stdafx.h6
-rw-r--r--protocols/IRCG/src/windows.cpp14
-rw-r--r--protocols/IcqOscarJ/src/icq_firstrun.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp6
-rw-r--r--protocols/IcqOscarJ/src/loginpassword.cpp6
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_captcha.cpp5
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp6
-rw-r--r--protocols/JabberG/src/jabber_console.cpp14
-rw-r--r--protocols/JabberG/src/jabber_form.cpp2
-rw-r--r--protocols/JabberG/src/jabber_frame.cpp6
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp2
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp16
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp57
-rw-r--r--protocols/JabberG/src/jabber_password.cpp2
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp8
-rw-r--r--protocols/JabberG/src/jabber_treelist.cpp2
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp7
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp2
-rw-r--r--protocols/JabberG/src/stdafx.h19
-rw-r--r--protocols/MRA/src/Mra_functions.cpp2
-rw-r--r--protocols/MSN/src/msn_menu.cpp3
-rw-r--r--protocols/Steam/src/steam_dialogs.cpp9
-rw-r--r--protocols/Tlen/src/stdafx.h2
-rw-r--r--protocols/Tlen/src/tlen.cpp2
-rw-r--r--protocols/Tlen/src/tlen_svc.cpp7
-rw-r--r--protocols/Tox/src/tox_multimedia.cpp3
-rw-r--r--protocols/VKontakte/src/vk_dialogs.cpp12
-rw-r--r--protocols/Yahoo/src/chat.cpp12
-rw-r--r--protocols/Yahoo/src/services.cpp9
-rw-r--r--protocols/Yahoo/src/stdafx.h1
-rw-r--r--protocols/Yahoo/src/user_info.cpp4
47 files changed, 128 insertions, 233 deletions
diff --git a/protocols/AimOscar/src/theme.cpp b/protocols/AimOscar/src/theme.cpp
index 139b7ca412..134011214f 100644
--- a/protocols/AimOscar/src/theme.cpp
+++ b/protocols/AimOscar/src/theme.cpp
@@ -57,7 +57,7 @@ static IconItem iconList[] =
void InitIcons(void)
{
Icon_Register(hInstance, "Protocols/AIM", iconList, 14, "AIM");
- Icon_Register(hInstance, "Protocols/AIM/" LPGEN("Profile Editor"), iconList+14, 14, "AIM");
+ Icon_Register(hInstance, "Protocols/AIM/" LPGEN("Profile Editor"), iconList + 14, 14, "AIM");
}
HICON LoadIconEx(const char *name, bool big)
@@ -69,8 +69,8 @@ HICON LoadIconEx(const char *name, bool big)
HANDLE GetIconHandle(const char *name)
{
- for (int i=0; i < _countof(iconList); i++)
- if ( !mir_strcmp(iconList[i].szName, name))
+ for (int i = 0; i < _countof(iconList); i++)
+ if (!mir_strcmp(iconList[i].szName, name))
return iconList[i].hIcolib;
return NULL;
@@ -83,12 +83,6 @@ void ReleaseIconEx(const char *name, bool big)
IcoLib_Release(szSettingName, big);
}
-void Window_SetIcon(HWND hWnd, const char* name)
-{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx( name, true ));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx( name ));
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// Extra Icons
@@ -139,14 +133,14 @@ void set_contact_icon(CAimProto* ppro, MCONTACT hContact)
void remove_AT_icons(CAimProto* ppro)
{
for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
- if (!ppro->isChatRoom(hContact))
+ if (!ppro->isChatRoom(hContact))
ExtraIcon_Clear(hExtraAT, hContact);
}
void remove_ES_icons(CAimProto* ppro)
{
for (MCONTACT hContact = db_find_first(ppro->m_szModuleName); hContact; hContact = db_find_next(hContact, ppro->m_szModuleName))
- if (!ppro->isChatRoom(hContact))
+ if (!ppro->isChatRoom(hContact))
ExtraIcon_Clear(hExtraES, hContact);
}
@@ -230,7 +224,7 @@ void CAimProto::InitMainMenus(void)
CreateProtoService(mi.pszService, &CAimProto::JoinChatUI);
mi.position = 201003;
mi.hIcolibItem = GetIconHandle("aol");
- mi.name.a = LPGEN( "Join Chat Room" );
+ mi.name.a = LPGEN("Join Chat Room");
m_hMainMenu[2] = Menu_AddProtoMenuItem(&mi, m_szModuleName);
}
@@ -239,7 +233,7 @@ void CAimProto::InitContactMenus(void)
CMenuItem mi;
SET_UID(mi, 0xb961e2af, 0x87a, 0x4fbf, 0xb5, 0x32, 0x6, 0xe2, 0x18, 0xad, 0x29, 0xac);
- CreateProtoService("/GetHTMLAwayMsg",&CAimProto::GetHTMLAwayMsg);
+ CreateProtoService("/GetHTMLAwayMsg", &CAimProto::GetHTMLAwayMsg);
mi.pszService = "/GetHTMLAwayMsg";
mi.position = -2000006000;
mi.hIcolibItem = GetIconHandle("away");
@@ -257,7 +251,7 @@ void CAimProto::InitContactMenus(void)
Menu_AddContactMenuItem(&mi, m_szModuleName);
SET_UID(mi, 0x3928ba10, 0x69bc, 0x4ec9, 0x96, 0x48, 0xa4, 0x1b, 0xbe, 0x58, 0x4a, 0x7e);
- CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
+ CreateProtoService("/AddToServerList", &CAimProto::AddToServerList);
mi.pszService = "/AddToServerList";
mi.position = -2000005080;
mi.hIcolibItem = GetIconHandle("add");
diff --git a/protocols/AimOscar/src/theme.h b/protocols/AimOscar/src/theme.h
index 70baf03d61..73fde85851 100644
--- a/protocols/AimOscar/src/theme.h
+++ b/protocols/AimOscar/src/theme.h
@@ -26,8 +26,6 @@ HICON LoadIconEx(const char *name, bool big = false);
HANDLE GetIconHandle(const char *name);
void ReleaseIconEx(const char *name, bool big = false);
-void Window_SetIcon(HWND hWnd, const char *name);
-
void add_AT_icons(CAimProto* ppro);
void remove_AT_icons(CAimProto* ppro);
void add_ES_icons(CAimProto* ppro);
diff --git a/protocols/AimOscar/src/ui.cpp b/protocols/AimOscar/src/ui.cpp
index 08efc8b35f..d8df3f87f6 100755
--- a/protocols/AimOscar/src/ui.cpp
+++ b/protocols/AimOscar/src/ui.cpp
@@ -1155,7 +1155,8 @@ INT_PTR CALLBACK instant_idle_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
ppro = (CAimProto*)lParam;
{
- Window_SetIcon(hwndDlg, "idle");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("idle"));
+
unsigned long it = ppro->getDword(AIM_KEY_IIT, 0);
unsigned long hours = it / 60;
unsigned long minutes = it % 60;
@@ -1216,7 +1217,7 @@ INT_PTR CALLBACK join_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
ppro = (CAimProto*)lParam;
- Window_SetIcon(hwndDlg, "aol");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("aol"));
break;
case WM_CLOSE:
@@ -1325,7 +1326,7 @@ INT_PTR CALLBACK invite_to_chat_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
param = (invite_chat_param*)lParam;
- Window_SetIcon(hwndDlg, "aol");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("aol"));
SetDlgItemTextA(hwndDlg, IDC_ROOMNAME, param->id);
SetDlgItemTextA(hwndDlg, IDC_MSG, Translate("Join me in this buddy chat!"));
break;
@@ -1414,7 +1415,7 @@ INT_PTR CALLBACK chat_request_dialog(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
param = (invite_chat_req_param*)lParam;
- Window_SetIcon(hwndDlg, "aol");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("aol"));
SetDlgItemTextA(hwndDlg, IDC_ROOMNAME, strrchr(param->cnp->id, '-') + 1);
SetDlgItemTextA(hwndDlg, IDC_SCREENNAME, param->name);
diff --git a/protocols/Dummy/src/dummy_options.cpp b/protocols/Dummy/src/dummy_options.cpp
index 7f86602d08..935dc955ff 100644
--- a/protocols/Dummy/src/dummy_options.cpp
+++ b/protocols/Dummy/src/dummy_options.cpp
@@ -46,8 +46,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
ppro = (CDummyProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon));
+ Window_SetIcon_IcoLib(hwndDlg, ppro->m_hProtoIcon);
{
SendDlgItemMessageA(hwndDlg, IDC_TEMPLATE, CB_INSERTSTRING, 0, reinterpret_cast<LPARAM>(Translate(templates[0].name)));
for (size_t i = 1; i < _countof(templates); i++)
@@ -108,8 +107,7 @@ INT_PTR CALLBACK DummyAccountProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case WM_DESTROY:
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
diff --git a/protocols/FacebookRM/src/captcha.cpp b/protocols/FacebookRM/src/captcha.cpp
index 1a1d167e3f..c1e82e8865 100644
--- a/protocols/FacebookRM/src/captcha.cpp
+++ b/protocols/FacebookRM/src/captcha.cpp
@@ -39,8 +39,7 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle("key"), TRUE));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle("key")));
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("key"));
params = (CAPTCHA_FORM_PARAMS*)lParam;
SetDlgItemText(hwndDlg, IDC_INSTRUCTION, TranslateT("Enter the text you see"));
@@ -95,8 +94,7 @@ static INT_PTR CALLBACK CaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
break;
case WM_DESTROY:
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
return FALSE;
diff --git a/protocols/FacebookRM/src/dialogs.cpp b/protocols/FacebookRM/src/dialogs.cpp
index 85571b2508..60ad764628 100644
--- a/protocols/FacebookRM/src/dialogs.cpp
+++ b/protocols/FacebookRM/src/dialogs.cpp
@@ -193,7 +193,7 @@ INT_PTR CALLBACK FBMindProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpara
{
TranslateDialogDefault(hwnd);
- SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle("mind")));
+ Window_SetIcon_IcoLib(hwnd, GetIconHandle("mind"));
data = reinterpret_cast<post_status_data*>(lparam);
@@ -650,8 +650,7 @@ CFacebookGuardDialog::CFacebookGuardDialog(FacebookProto *proto, const char *fb_
void CFacebookGuardDialog::OnInitDialog()
{
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle("facebook"), TRUE));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle("facebook")));
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle("facebook"));
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0);
diff --git a/protocols/Gadu-Gadu/src/gg.h b/protocols/Gadu-Gadu/src/gg.h
index 7a8d0978e2..a06ed4dfb2 100644
--- a/protocols/Gadu-Gadu/src/gg.h
+++ b/protocols/Gadu-Gadu/src/gg.h
@@ -322,8 +322,6 @@ void gg_icolib_init();
HICON LoadIconEx(const char* name, bool big);
HANDLE GetIconHandle(int iconId);
void ReleaseIconEx(const char* name, bool big);
-void WindowSetIcon(HWND hWnd, const char* name);
-void WindowFreeIcon(HWND hWnd);
/* URI parser functions */
void gg_links_instancemenu_init();
diff --git a/protocols/Gadu-Gadu/src/groupchat.cpp b/protocols/Gadu-Gadu/src/groupchat.cpp
index ba8ad0b620..305e398548 100644
--- a/protocols/Gadu-Gadu/src/groupchat.cpp
+++ b/protocols/Gadu-Gadu/src/groupchat.cpp
@@ -442,7 +442,7 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)lParam);
TranslateDialogDefault(hwndDlg);
- WindowSetIcon(hwndDlg, "conference");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_CONFERENCE));
gg_gc_resetclistopts(GetDlgItem(hwndDlg, IDC_CLIST));
// Hook MetaContacts event (if available)
@@ -567,8 +567,9 @@ static INT_PTR CALLBACK gg_gc_openconfdlg(HWND hwndDlg, UINT message, WPARAM wPa
case WM_DESTROY:
{
HANDLE hMetaContactsEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- if (hMetaContactsEvent) UnhookEvent(hMetaContactsEvent);
- WindowFreeIcon(hwndDlg);
+ if (hMetaContactsEvent)
+ UnhookEvent(hMetaContactsEvent);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
}
diff --git a/protocols/Gadu-Gadu/src/icolib.cpp b/protocols/Gadu-Gadu/src/icolib.cpp
index ea6e2503a2..0a81610891 100644
--- a/protocols/Gadu-Gadu/src/icolib.cpp
+++ b/protocols/Gadu-Gadu/src/icolib.cpp
@@ -69,15 +69,3 @@ void ReleaseIconEx(const char* name, bool big)
mir_snprintf(szSettingName, "%s_%s", GGDEF_PROTO, name);
IcoLib_Release(szSettingName, big);
}
-
-void WindowSetIcon(HWND hWnd, const char* name)
-{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx(name, TRUE));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx(name, FALSE));
-}
-
-void WindowFreeIcon(HWND hWnd)
-{
- IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0));
-}
diff --git a/protocols/Gadu-Gadu/src/image.cpp b/protocols/Gadu-Gadu/src/image.cpp
index 2f9d849c7e..87ccaa2a54 100644
--- a/protocols/Gadu-Gadu/src/image.cpp
+++ b/protocols/Gadu-Gadu/src/image.cpp
@@ -416,8 +416,8 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_IMG_SAVE, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Save image to disk"), BATF_TCHAR);
// Set main window image
- WindowSetIcon(hwndDlg, "image");
-
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_IMAGE));
+
TCHAR *szName = pcli->pfnGetContactDisplayName(dat->hContact, 0), szTitle[128];
if (dat->bReceiving)
mir_sntprintf(szTitle, TranslateT("Image from %s"), szName);
@@ -519,7 +519,7 @@ static INT_PTR CALLBACK gg_img_dlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ReleaseIconEx("next", FALSE);
ReleaseIconEx("delete", FALSE);
ReleaseIconEx("save", FALSE);
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
gg->gg_EnterCriticalSection(&gg->img_mutex, "gg_img_dlgproc", 58, "img_mutex", 1);
list_remove(&gg->imagedlgs, dat, 1);
gg->gg_LeaveCriticalSection(&gg->img_mutex, "gg_img_dlgproc", 58, 1, "img_mutex", 1);
diff --git a/protocols/Gadu-Gadu/src/sessions.cpp b/protocols/Gadu-Gadu/src/sessions.cpp
index 6ef0fafce7..ba881c9d3a 100644
--- a/protocols/Gadu-Gadu/src/sessions.cpp
+++ b/protocols/Gadu-Gadu/src/sessions.cpp
@@ -170,7 +170,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
GetWindowText(hwndDlg, oldTitle, _countof(oldTitle));
mir_sntprintf(newTitle, oldTitle, gg->m_tszUserName);
SetWindowText(hwndDlg, newTitle);
- WindowSetIcon(hwndDlg, "sessions");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_SESSIONS));
if (hHandCursor == NULL)
hHandCursor = LoadCursor(NULL, IDC_HAND);
@@ -383,7 +383,7 @@ static INT_PTR CALLBACK gg_sessions_viewdlg(HWND hwndDlg, UINT message, WPARAM w
HANDLE hProtoAckEvent = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hProtoAckEvent) UnhookEvent(hProtoAckEvent);
gg->hwndSessionsDlg = NULL;
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
}
diff --git a/protocols/Gadu-Gadu/src/userutils.cpp b/protocols/Gadu-Gadu/src/userutils.cpp
index e513112247..90cc89579a 100644
--- a/protocols/Gadu-Gadu/src/userutils.cpp
+++ b/protocols/Gadu-Gadu/src/userutils.cpp
@@ -211,7 +211,7 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
{
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- WindowSetIcon(hwndDlg, "settings");
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_SETTINGS));
dat = (GGUSERUTILDLGDATA *)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)lParam);
if (dat) SetDlgItemTextA(hwndDlg, IDC_EMAIL, dat->email); // Readup email
@@ -271,7 +271,7 @@ INT_PTR CALLBACK gg_userutildlgproc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case WM_DESTROY:
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
return FALSE;
diff --git a/protocols/IRCG/src/ircproto.cpp b/protocols/IRCG/src/ircproto.cpp
index 98de854279..0f4caf2a54 100644
--- a/protocols/IRCG/src/ircproto.cpp
+++ b/protocols/IRCG/src/ircproto.cpp
@@ -719,7 +719,7 @@ int CIrcProto::SetStatusInternal(int iNewStatus, bool bIsInternal)
SetWindowTextA(hwnd, "Miranda IRC");
SetDlgItemText(hwnd, IDC_TEXT, TranslateT("Please choose an IRC-network to go online. This network will be the default."));
SetDlgItemText(hwnd, IDC_CAPTION, TranslateT("Default network"));
- WindowSetIcon(hwnd, IDI_MAIN);
+ Window_SetIcon_IcoLib(hwnd, GetIconHandle(IDI_MAIN));
ShowWindow(hwnd, SW_SHOW);
SetActiveWindow(hwnd);
}
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 4fe3b827e4..7d13696798 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -228,24 +228,6 @@ HANDLE GetIconHandle(int iconId)
return NULL;
}
-void ReleaseIconEx(HICON hIcon)
-{
- if (hIcon)
- IcoLib_ReleaseIcon(hIcon);
-}
-
-void WindowSetIcon(HWND hWnd, int iconId)
-{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx(iconId, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx(iconId));
-}
-
-void WindowFreeIcon(HWND hWnd)
-{
- ReleaseIconEx((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0));
- ReleaseIconEx((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0));
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// code page handler
diff --git a/protocols/IRCG/src/services.cpp b/protocols/IRCG/src/services.cpp
index 46241256c7..19909dfc4b 100644
--- a/protocols/IRCG/src/services.cpp
+++ b/protocols/IRCG/src/services.cpp
@@ -351,7 +351,7 @@ INT_PTR __cdecl CIrcProto::OnQuickConnectMenuCommand(WPARAM, LPARAM)
SetWindowText(m_quickDlg->GetHwnd(), TranslateT("Quick connect"));
SetDlgItemText(m_quickDlg->GetHwnd(), IDC_TEXT, TranslateT("Please select IRC network and enter the password if needed"));
SetDlgItemText(m_quickDlg->GetHwnd(), IDC_CAPTION, TranslateT("Quick connect"));
- WindowSetIcon(m_quickDlg->GetHwnd(), IDI_QUICK);
+ Window_SetIcon_IcoLib(m_quickDlg->GetHwnd(), GetIconHandle(IDI_QUICK));
}
ShowWindow(m_quickDlg->GetHwnd(), SW_SHOW);
diff --git a/protocols/IRCG/src/stdafx.h b/protocols/IRCG/src/stdafx.h
index bc450f78ac..6870a538d2 100644
--- a/protocols/IRCG/src/stdafx.h
+++ b/protocols/IRCG/src/stdafx.h
@@ -610,15 +610,11 @@ void InitServers(void);
void RereadServers(void);
void InitContactMenus(void);
-void UninitContactMenus(void);
-
-void WindowSetIcon(HWND hWnd, int iconId);
-void WindowFreeIcon(HWND hWnd);
+void UninitContactMenus(void);
void InitIcons(void);
HICON LoadIconEx(int iIndex, bool big = false);
HANDLE GetIconHandle(int iconId);
-void ReleaseIconEx(HICON hIcon);
//tools.cpp
int __stdcall WCCmp(const TCHAR* wild, const TCHAR* string);
diff --git a/protocols/IRCG/src/windows.cpp b/protocols/IRCG/src/windows.cpp
index fded5db590..78417104da 100644
--- a/protocols/IRCG/src/windows.cpp
+++ b/protocols/IRCG/src/windows.cpp
@@ -87,7 +87,7 @@ void CWhoisDlg::OnInitDialog()
CCoolIrcDlg::OnInitDialog();
- WindowSetIcon(m_hwnd, IDI_WHOIS);
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WHOIS));
}
void CWhoisDlg::OnClose()
@@ -208,7 +208,7 @@ CNickDlg::CNickDlg(CIrcProto *_pro)
void CNickDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
- WindowSetIcon(m_hwnd, IDI_RENAME);
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_RENAME));
DBVARIANT dbv;
if (!m_proto->getTString("RecentNicks", &dbv)) {
@@ -292,7 +292,7 @@ void CListDlg::OnInitDialog()
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
m_list2.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT);
- WindowSetIcon(m_hwnd, IDI_LIST);
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_LIST));
m_status.SetText(TranslateT("Please wait..."));
}
@@ -714,7 +714,7 @@ void CQuestionDlg::OnInitDialog()
{
CCoolIrcDlg::OnInitDialog();
- WindowSetIcon(m_hwnd, IDI_IRCQUESTION);
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_IRCQUESTION));
}
void CQuestionDlg::OnClose()
@@ -873,7 +873,7 @@ void CManagerDlg::OnInitDialog()
HWND hwndEdit = ChildWindowFromPoint(m_topic.GetHwnd(), pt);
mir_subclassWindow(hwndEdit, MgrEditSubclassProc);
- WindowSetIcon(m_hwnd, IDI_MANAGER);
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_MANAGER));
m_list.SendMsg(LB_SETHORIZONTALEXTENT, 750, NULL);
m_radio1.SetState(true);
@@ -1395,8 +1395,8 @@ void CCoolIrcDlg::OnDestroy()
SendDlgItemMessage(m_hwnd, IDC_CAPTION, WM_SETFONT, SendDlgItemMessage(m_hwnd, IDOK, WM_GETFONT, 0, 0), 0);
DeleteObject(hFont);
- ReleaseIconEx((HICON)SendDlgItemMessage(m_hwnd, IDC_LOGO, STM_SETICON, 0, 0));
- WindowFreeIcon(m_hwnd);
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_LOGO, STM_SETICON, 0, 0));
+ Window_FreeIcon_IcoLib(m_hwnd);
}
INT_PTR CCoolIrcDlg::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp
index 91a5de00f0..6edbd69a04 100644
--- a/protocols/IcqOscarJ/src/icq_firstrun.cpp
+++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp
@@ -50,8 +50,7 @@ INT_PTR CALLBACK icq_FirstRunDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ppro = (CIcqProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon));
+ Window_SetIcon_IcoLib(hwndDlg, ppro->m_hProtoIcon);
SendDlgItemMessage(hwndDlg, IDC_PW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
@@ -59,8 +58,7 @@ INT_PTR CALLBACK icq_FirstRunDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
return TRUE;
case WM_DESTROY:
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
case WM_CLOSE:
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index d2443c4943..6d428290aa 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -758,10 +758,8 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue);
SAFE_FREE(&szValue);
- if (dat->bXStatus) {
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
- }
+ if (dat->bXStatus)
+ Window_FreeIcon_IcoLib(hwndDlg);
}
dat->ppro->updateServerCustomStatus(TRUE);
}
diff --git a/protocols/IcqOscarJ/src/loginpassword.cpp b/protocols/IcqOscarJ/src/loginpassword.cpp
index 81ea3741ed..02cfbbd7eb 100644
--- a/protocols/IcqOscarJ/src/loginpassword.cpp
+++ b/protocols/IcqOscarJ/src/loginpassword.cpp
@@ -36,8 +36,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
ppro = (CIcqProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(ppro->m_hProtoIcon));
+ Window_SetIcon_IcoLib(hwndDlg, ppro->m_hProtoIcon);
{
DWORD dwUin = ppro->getContactUin(NULL);
@@ -52,8 +51,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
break;
case WM_DESTROY:
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
case WM_CLOSE:
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index e18b14207d..1c2c64c15d 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -494,7 +494,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA
case WM_DESTROY:
JabberFormDestroyUI(GetDlgItem(hwndDlg, IDC_FRAME));
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
dat->proto->m_hwndCommandWindow = NULL;
mir_free(dat->ResponderJID);
diff --git a/protocols/JabberG/src/jabber_captcha.cpp b/protocols/JabberG/src/jabber_captcha.cpp
index 607bb047a2..5119579a86 100644
--- a/protocols/JabberG/src/jabber_captcha.cpp
+++ b/protocols/JabberG/src/jabber_captcha.cpp
@@ -44,8 +44,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (msg) {
case WM_INITDIALOG: {
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(IDI_KEYS, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(IDI_KEYS));
+ Window_SetSkinIcon_IcoLib(hwndDlg, IDI_KEYS);
params = (CAPTCHA_FORM_PARAMS*)lParam;
LPCTSTR hint = params->hint;
@@ -104,7 +103,7 @@ INT_PTR CALLBACK JabberCaptchaFormDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case WM_DESTROY:
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
return FALSE;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 23bfb6e3f0..be0f1efadf 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -976,9 +976,9 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
break;
case WM_DESTROY:
- WindowFreeIcon(hwndDlg);
- g_ReleaseIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_BTN_AFFILIATION, BM_SETIMAGE, IMAGE_ICON, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_BTN_ROLE, BM_SETIMAGE, IMAGE_ICON, 0));
+ Window_FreeIcon_IcoLib(hwndDlg);
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_BTN_AFFILIATION, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(hwndDlg, IDC_BTN_ROLE, BM_SETIMAGE, IMAGE_ICON, 0));
if (dat) {
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
mir_free(dat);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 9b55445cd9..721fed6aac 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -380,7 +380,7 @@ void CJabberDlgConsole::OnInitDialog()
for (int i=0; i < _countof(filter_modes); i++)
if (filter_modes[i].type == m_proto->m_filterInfo.type) {
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon)));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon)));
SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon));
break;
}
@@ -406,11 +406,11 @@ void CJabberDlgConsole::OnClose()
void CJabberDlgConsole::OnDestroy()
{
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_MSG, BM_SETIMAGE, IMAGE_ICON, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_PRESENCE, BM_SETIMAGE, IMAGE_ICON, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_IQ, BM_SETIMAGE, IMAGE_ICON, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER_REFRESH, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_MSG, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_PRESENCE, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_IQ, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER_REFRESH, BM_SETIMAGE, IMAGE_ICON, 0));
m_proto->m_pDlgConsole = NULL;
CSuper::OnDestroy();
@@ -580,7 +580,7 @@ INT_PTR CJabberDlgConsole::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_proto->m_filterInfo.type = (TFilterInfo::Type)(res - 1);
for (i = 0; i < _countof(filter_modes); i++) {
if (filter_modes[i].type == m_proto->m_filterInfo.type) {
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon)));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(filter_modes[i].icon)));
break;
}
}
diff --git a/protocols/JabberG/src/jabber_form.cpp b/protocols/JabberG/src/jabber_form.cpp
index e871ca0eb2..c8ad8a03b7 100644
--- a/protocols/JabberG/src/jabber_form.cpp
+++ b/protocols/JabberG/src/jabber_form.cpp
@@ -376,7 +376,7 @@ TJabberFormControlInfo *JabberFormAppendControl(HWND hwndStatic, TJabberFormLayo
return item;
}
-void JabberFormAddListItem(TJabberFormControlInfo *item, const TCHAR *text, bool selected)
+static void JabberFormAddListItem(TJabberFormControlInfo *item, const TCHAR *text, bool selected)
{
DWORD dwIndex;
switch (item->type) {
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp
index 2703d09625..d6bf5afce7 100644
--- a/protocols/JabberG/src/jabber_frame.cpp
+++ b/protocols/JabberG/src/jabber_frame.cpp
@@ -364,7 +364,7 @@ void CJabberInfoFrame::PaintCompact(HDC hdc)
HICON hIcon = IcoLib_GetIconByHandle(item.m_hIcolibIcon);
if (hIcon) {
DrawIconEx(hdc, SZ_FRAMEPADDING, (rc.bottom-cy_icon)/2, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
}
}
@@ -379,7 +379,7 @@ void CJabberInfoFrame::PaintCompact(HDC hdc)
DrawIconEx(hdc, cx, (rc.bottom-cy_icon)/2, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
cx -= cx_icon;
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
SetToolTip(item.m_tooltipId, &item.m_rcItem, item.m_pszText);
}
@@ -424,7 +424,7 @@ void CJabberInfoFrame::PaintNormal(HDC hdc)
DrawIconEx(hdc, cx, cy + (line_height-cy_icon)/2, hIcon, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
cx += cx_icon + SZ_ICONSPACING;
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
}
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 5f15f762f1..348f62bfda 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -479,7 +479,7 @@ void CJabberDlgGcJoin::OnInitDialog()
void CJabberDlgGcJoin::OnDestroy()
{
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, 0));
m_proto->m_pDlgJabberJoinGroupchat = NULL;
DeleteObject((HFONT)SendDlgItemMessage(m_hwnd, IDC_TXT_RECENT, WM_GETFONT, 0, 0));
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index 1db364b465..01361f011c 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -552,26 +552,12 @@ HICON g_LoadIconEx(const char* name, bool big)
return IcoLib_GetIcon(szSettingName, big);
}
-void g_ReleaseIcon(HICON hIcon)
-{
- if (hIcon)
- IcoLib_ReleaseIcon(hIcon);
-}
-
void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon)
{
ImageList_AddIcon(hIml, hIcon);
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
}
void WindowSetIcon(HWND hWnd, CJabberProto *proto, const char* name)
{
- SendMessage(hWnd, WM_SETICON, ICON_BIG, (LPARAM)proto->LoadIconEx(name, true));
- SendMessage(hWnd, WM_SETICON, ICON_SMALL, (LPARAM)proto->LoadIconEx(name));
-}
-
-void WindowFreeIcon(HWND hWnd)
-{
- g_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_BIG, 0));
- g_ReleaseIcon((HICON)SendMessage(hWnd, WM_SETICON, ICON_SMALL, 0));
}
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 8130aa286c..28e5f33660 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -1393,45 +1393,42 @@ static INT_PTR CALLBACK JabberRosterOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
CJabberProto *ppro = (CJabberProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
switch (msg) {
+ case WM_INITDIALOG:
+ ppro = (CJabberProto*)lParam;
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
+
+ TranslateDialogDefault(hwndDlg);
+ WindowSetIcon(hwndDlg, ppro, "Agents");
+
+ Utils_RestoreWindowPosition(hwndDlg, NULL, ppro->m_szModuleName, "rosterCtrlWnd_");
+
+ ListView_SetExtendedListViewStyle(GetDlgItem(hwndDlg, IDC_ROSTER), LVS_EX_CHECKBOXES | LVS_EX_BORDERSELECT /*| LVS_EX_FULLROWSELECT*/ | LVS_EX_GRIDLINES /*| LVS_EX_HEADERDRAGDROP*/);
+ mir_subclassWindow(GetDlgItem(hwndDlg, IDC_ROSTER), _RosterNewListProc);
+ _RosterListClear(hwndDlg);
+ ppro->rrud.hwndDlg = hwndDlg;
+ ppro->rrud.bReadyToDownload = TRUE;
+ ppro->rrud.bReadyToUpload = FALSE;
+ SendMessage(hwndDlg, JM_STATUSCHANGED, 0, 0);
+ return TRUE;
+
case JM_STATUSCHANGED:
{
int count = ListView_GetItemCount(GetDlgItem(hwndDlg, IDC_ROSTER));
EnableWindow(GetDlgItem(hwndDlg, IDC_DOWNLOAD), ppro->m_bJabberOnline);
EnableWindow(GetDlgItem(hwndDlg, IDC_UPLOAD), count && ppro->m_bJabberOnline);
EnableWindow(GetDlgItem(hwndDlg, IDC_EXPORT), count > 0);
- break;
- }
- case WM_CLOSE:
- {
- DestroyWindow(hwndDlg);
- break;
- }
- case WM_DESTROY:
- {
- Utils_SaveWindowPosition(hwndDlg, NULL, ppro->m_szModuleName, "rosterCtrlWnd_");
- ppro->rrud.hwndDlg = NULL;
- WindowFreeIcon(hwndDlg);
- break;
}
- case WM_INITDIALOG:
- {
- ppro = (CJabberProto*)lParam;
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
-
- TranslateDialogDefault(hwndDlg);
- WindowSetIcon(hwndDlg, ppro, "Agents");
+ break;
- Utils_RestoreWindowPosition(hwndDlg, NULL, ppro->m_szModuleName, "rosterCtrlWnd_");
+ case WM_CLOSE:
+ DestroyWindow(hwndDlg);
+ break;
- ListView_SetExtendedListViewStyle(GetDlgItem(hwndDlg, IDC_ROSTER), LVS_EX_CHECKBOXES | LVS_EX_BORDERSELECT /*| LVS_EX_FULLROWSELECT*/ | LVS_EX_GRIDLINES /*| LVS_EX_HEADERDRAGDROP*/);
- mir_subclassWindow(GetDlgItem(hwndDlg, IDC_ROSTER), _RosterNewListProc);
- _RosterListClear(hwndDlg);
- ppro->rrud.hwndDlg = hwndDlg;
- ppro->rrud.bReadyToDownload = TRUE;
- ppro->rrud.bReadyToUpload = FALSE;
- SendMessage(hwndDlg, JM_STATUSCHANGED, 0, 0);
- }
- return TRUE;
+ case WM_DESTROY:
+ Utils_SaveWindowPosition(hwndDlg, NULL, ppro->m_szModuleName, "rosterCtrlWnd_");
+ ppro->rrud.hwndDlg = NULL;
+ Window_FreeIcon_IcoLib(hwndDlg);
+ break;
case WM_GETMINMAXINFO:
{
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp
index 3ca63f9121..4fe3ae4ab0 100644
--- a/protocols/JabberG/src/jabber_password.cpp
+++ b/protocols/JabberG/src/jabber_password.cpp
@@ -90,7 +90,7 @@ static INT_PTR CALLBACK JabberChangePasswordDlgProc(HWND hwndDlg, UINT msg, WPAR
break;
case WM_DESTROY:
ppro->m_hwndJabberChangePassword = NULL;
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 0f56b27c7a..3dd5805f00 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -545,10 +545,10 @@ public:
void OnDestroy()
{
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, 0, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, 0, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, 0, 0));
- g_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, 0, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, 0, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, 0, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, 0, 0));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, 0, 0));
m_proto->m_hwndPrivacyRule = NULL;
}
};
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp
index ea66936cad..33d0acf232 100644
--- a/protocols/JabberG/src/jabber_treelist.cpp
+++ b/protocols/JabberG/src/jabber_treelist.cpp
@@ -249,7 +249,7 @@ int TreeList_AddIcon(HWND hwnd, HICON hIcon, int iOverlay)
{
HIMAGELIST hIml = ListView_GetImageList(hwnd, LVSIL_SMALL);
int idx = ImageList_AddIcon(hIml, hIcon);
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
if (iOverlay) ImageList_SetOverlayImage(hIml, idx, iOverlay);
return idx;
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index 380e1c05ad..7601a92287 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -190,7 +190,7 @@ static HTREEITEM sttFillInfoLine(HWND hwndTree, HTREEITEM htiRoot, HICON hIcon,
tvis.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvis.itemex.iImage =
tvis.itemex.iSelectedImage = ImageList_AddIcon(himl, hIcon);
- g_ReleaseIcon(hIcon);
+ IcoLib_ReleaseIcon(hIcon);
}
if (hti) {
@@ -439,8 +439,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
// lParam is hContact
TranslateDialogDefault(hwndDlg);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_USERDETAILS, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_OTHER_USERDETAILS);
dat = (JabberUserInfoDlgData *)mir_alloc(sizeof(JabberUserInfoDlgData));
memset(dat, 0, sizeof(JabberUserInfoDlgData));
@@ -585,7 +584,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
}
WindowList_Remove(hUserInfoList, hwndDlg);
ImageList_Destroy(TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TV_INFO), NULL, TVSIL_NORMAL));
- WindowFreeIcon(hwndDlg);
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
return FALSE;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index a4ac9974ed..e654238361 100644
--- a/protocols/JabberG/src/jabber_xstatus.cpp
+++ b/protocols/JabberG/src/jabber_xstatus.cpp
@@ -155,7 +155,7 @@ private:
bool m_subitem;
CStatusMode(LPARAM id, char *name, HICON hIcon, TCHAR *title, bool subitem): m_id(id), m_name(name), m_hIcon(hIcon), m_title(title), m_subitem(subitem) {}
- ~CStatusMode() { g_ReleaseIcon(m_hIcon); }
+ ~CStatusMode() { IcoLib_ReleaseIcon(m_hIcon); }
};
OBJLIST<CStatusMode> m_modes;
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h
index b625d69ecd..429ec8f418 100644
--- a/protocols/JabberG/src/stdafx.h
+++ b/protocols/JabberG/src/stdafx.h
@@ -624,7 +624,6 @@ LPARAM TreeList_GetData(HTREELISTITEM hItem);
HTREELISTITEM TreeList_GetRoot(HWND hwnd);
int TreeList_GetChildrenCount(HTREELISTITEM hItem);
HTREELISTITEM TreeList_GetChild(HTREELISTITEM hItem, int i);
-void sttTreeList_RecursiveApply(HTREELISTITEM hItem, void (*func)(HTREELISTITEM, LPARAM), LPARAM data);
void TreeList_Update(HWND hwnd);
BOOL TreeList_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, UINT idc, BOOL *result);
@@ -645,11 +644,8 @@ void JabberFormDestroyUI(HWND hwndStatic);
void JabberFormSetInstruction(HWND hwndForm, const TCHAR *text);
HJFORMLAYOUT JabberFormCreateLayout(HWND hwndStatic); // use mir_free to destroy
HJFORMCTRL JabberFormAppendControl(HWND hwndStatic, HJFORMLAYOUT layout_info, TJabberFormControlType type, const TCHAR *labelStr, const TCHAR *valueStr);
-void JabberFormAddListItem(HJFORMCTRL item, const TCHAR *text, bool selected);
void JabberFormLayoutControls(HWND hwndStatic, HJFORMLAYOUT layout_info, int *formHeight);
-void JabberFormCreateDialog(HXML xNode, TCHAR* defTitle, JABBER_FORM_SUBMIT_FUNC pfnSubmit, void *userdata);
-
HXML JabberFormGetData(HWND hwndStatic, HXML xNode);
//---- jabber_icolib.c ----------------------------------------------
@@ -658,13 +654,9 @@ void g_IconsInit();
void g_XstatusIconsInit();
HANDLE g_GetIconHandle(int iconId);
HICON g_LoadIconEx(const char* name, bool big = false);
-void g_ReleaseIcon(HICON hIcon);
void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon);
void WindowSetIcon(HWND hWnd, CJabberProto *proto, const char* name);
-void WindowFreeIcon(HWND hWnd);
-
-int ReloadIconsEventHook(WPARAM wParam, LPARAM lParam);
//---- jabber_libstr.c ----------------------------------------------
@@ -729,7 +721,7 @@ struct TStringPairs
const char* operator[](const char* name) const;
int numElems;
- TStringPairsElem* elems;
+ TStringPairsElem *elems;
};
typedef char JabberShaStrBuf[2*MIR_SHA1_HASH_SIZE + 1];
@@ -753,9 +745,9 @@ LPCTSTR __stdcall JabberGetPictureType(HXML node, const char *picBuf);
TCHAR* time2str(time_t _time, TCHAR *buf, size_t bufLen);
time_t str2time(const TCHAR*);
-const TCHAR *JabberStrIStr(const TCHAR *str, const TCHAR *substr);
-void JabberCopyText(HWND hwnd, const TCHAR *text);
-CJabberProto *JabberChooseInstance(bool bIsLink=false);
+const TCHAR* JabberStrIStr(const TCHAR *str, const TCHAR *substr);
+void JabberCopyText(HWND hwnd, const TCHAR *text);
+CJabberProto* JabberChooseInstance(bool bIsLink=false);
bool JabberReadXep203delay(HXML node, time_t &msgTime);
@@ -766,7 +758,4 @@ void UIShowControls(HWND hwndDlg, int *idList, int nCmdShow);
void JabberUserInfoUpdate(MCONTACT hContact);
-//---- jabber_iq_handlers.cpp
-BOOL GetOSDisplayString(LPTSTR pszOS, int BUFSIZE);
-
#endif
diff --git a/protocols/MRA/src/Mra_functions.cpp b/protocols/MRA/src/Mra_functions.cpp
index 1ce63f67ba..6f399df52c 100644
--- a/protocols/MRA/src/Mra_functions.cpp
+++ b/protocols/MRA/src/Mra_functions.cpp
@@ -1106,7 +1106,7 @@ INT_PTR CALLBACK SendReplyBlogStatusDlgProc(HWND hWndDlg, UINT message, WPARAM w
mir_subclassWindow(GetDlgItem(hWndDlg, IDC_MSG_TO_SEND), MessageEditSubclassProc);
SendMessage(hWndEdit, EM_LIMITTEXT, MICBLOG_STATUS_MAX, 0);
- SendMessage(hWndDlg, WM_SETICON, ICON_BIG, (LPARAM)IconLibGetIcon(gdiMenuItems[4].hIcolib));
+ Window_SetIcon_IcoLib(hWndDlg, gdiMenuItems[4].hIcolib);
// blog status message
CMStringW szBuff;
diff --git a/protocols/MSN/src/msn_menu.cpp b/protocols/MSN/src/msn_menu.cpp
index d607bb1dbb..532242e257 100644
--- a/protocols/MSN/src/msn_menu.cpp
+++ b/protocols/MSN/src/msn_menu.cpp
@@ -194,8 +194,7 @@ static INT_PTR CALLBACK DlgProcSetNickname(HWND hwndDlg, UINT msg, WPARAM wParam
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
CMsnProto* proto = (CMsnProto*)lParam;
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("main", true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx("main"));
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("main"));
SendDlgItemMessage(hwndDlg, IDC_NICKNAME, EM_LIMITTEXT, 129, 0);
DBVARIANT dbv;
diff --git a/protocols/Steam/src/steam_dialogs.cpp b/protocols/Steam/src/steam_dialogs.cpp
index 9bbdd73b7f..8cab0aecf3 100644
--- a/protocols/Steam/src/steam_dialogs.cpp
+++ b/protocols/Steam/src/steam_dialogs.cpp
@@ -11,8 +11,7 @@ void CSteamPasswordEditor::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, true));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, false));
+ Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
SendMessage(m_password.GetHwnd(), EM_LIMITTEXT, 64, 0);
@@ -52,8 +51,7 @@ void CSteamGuardDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, true));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, false));
+ Window_SetIcon_IcoLib(m_hwnd, iconName);
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 5, 0);
@@ -100,8 +98,7 @@ void CSteamCaptchaDialog::OnInitDialog()
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, "main");
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, true));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, false));
+ Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
SendMessage(m_text.GetHwnd(), EM_LIMITTEXT, 6, 0);
diff --git a/protocols/Tlen/src/stdafx.h b/protocols/Tlen/src/stdafx.h
index cc69fef948..9341656dc3 100644
--- a/protocols/Tlen/src/stdafx.h
+++ b/protocols/Tlen/src/stdafx.h
@@ -64,6 +64,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_contacts.h>
#include <m_clist.h>
#include <m_options.h>
+#include <m_icolib.h>
#include <m_userinfo.h>
#include <m_database.h>
#include <m_langpack.h>
@@ -429,6 +430,7 @@ extern HANDLE hMainThread;
* Function declarations
*******************************************************************/
HICON GetIcolibIcon(int iconId);
+HANDLE GetIconHandle(int iconId);
void ReleaseIcolibIcon(HICON hIcon);
void __cdecl TlenServerThread(ThreadData *info);
diff --git a/protocols/Tlen/src/tlen.cpp b/protocols/Tlen/src/tlen.cpp
index 250c5ae023..e7ce5b729b 100644
--- a/protocols/Tlen/src/tlen.cpp
+++ b/protocols/Tlen/src/tlen.cpp
@@ -80,7 +80,7 @@ static IconItem iconList[] =
{ LPGEN("Send image"), "IMAGE", IDI_IMAGE }
};
-static HANDLE GetIconHandle(int iconId)
+HANDLE GetIconHandle(int iconId)
{
for (int i = 0; i < _countof(iconList); i++)
if (iconList[i].defIconID == iconId)
diff --git a/protocols/Tlen/src/tlen_svc.cpp b/protocols/Tlen/src/tlen_svc.cpp
index ab0cb4324c..9ce4fc360e 100644
--- a/protocols/Tlen/src/tlen_svc.cpp
+++ b/protocols/Tlen/src/tlen_svc.cpp
@@ -1057,13 +1057,10 @@ static INT_PTR CALLBACK TlenChangeAvatarDlgProc(HWND hwndDlg, UINT msg, WPARAM w
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- {
- HICON hIcon = GetIcolibIcon(IDI_TLEN);
- SendMessage(hwndDlg, WM_SETICON, (WPARAM)ICON_BIG, (LPARAM)hIcon);
- ReleaseIcolibIcon(hIcon);
- }
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle(IDI_TLEN));
CheckDlgButton(hwndDlg, IDC_PUBLICAVATAR, BST_CHECKED);
return TRUE;
+
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDOK:
diff --git a/protocols/Tox/src/tox_multimedia.cpp b/protocols/Tox/src/tox_multimedia.cpp
index 8bc9fd8dd3..48526fa19e 100644
--- a/protocols/Tox/src/tox_multimedia.cpp
+++ b/protocols/Tox/src/tox_multimedia.cpp
@@ -28,8 +28,7 @@ void CToxCallDlgBase::SetIcon(const char *name)
{
char iconName[100];
mir_snprintf(iconName, "%s_%s", MODULE, name);
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIcon(iconName, false));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIcon(iconName, true));
+ Window_SetIcon_IcoLib(m_hwnd, IcoLib_GetIconHandle(iconName));
}
void CToxCallDlgBase::SetTitle(const TCHAR *title)
diff --git a/protocols/VKontakte/src/vk_dialogs.cpp b/protocols/VKontakte/src/vk_dialogs.cpp
index ed601d1a76..21fe217e6d 100644
--- a/protocols/VKontakte/src/vk_dialogs.cpp
+++ b/protocols/VKontakte/src/vk_dialogs.cpp
@@ -34,8 +34,7 @@ CVkCaptchaForm::CVkCaptchaForm(CVkProto *proto, CAPTCHA_FORM_PARAMS *param) :
void CVkCaptchaForm::OnInitDialog()
{
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_KEYS), TRUE));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_KEYS)));
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_KEYS));
m_btnOk.Disable();
m_btnOpenInBrowser.Enable((m_param->bmp != NULL));
@@ -83,8 +82,7 @@ INT_PTR CVkCaptchaForm::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
void CVkCaptchaForm::OnDestroy()
{
- IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(m_hwnd);
}
void CVkCaptchaForm::On_btnOpenInBrowser_Click(CCtrlButton*)
@@ -120,8 +118,7 @@ CVkWallPostForm::CVkWallPostForm(CVkProto *proto, WALLPOST_FORM_PARAMS *param) :
void CVkWallPostForm::OnInitDialog()
{
- SendMessage(m_hwnd, WM_SETICON, ICON_BIG, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL), TRUE));
- SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, (LPARAM)IcoLib_GetIconByHandle(GetIconHandle(IDI_WALL)));
+ Window_SetIcon_IcoLib(m_hwnd, GetIconHandle(IDI_WALL));
CMString tszTitle(FORMAT, _T("%s %s"), TranslateT("Wall message for"), m_param->ptszNick);
SetCaption(tszTitle);
@@ -131,8 +128,7 @@ void CVkWallPostForm::OnInitDialog()
void CVkWallPostForm::OnDestroy()
{
- IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_BIG, 0));
- IcoLib_ReleaseIcon((HICON)SendMessage(m_hwnd, WM_SETICON, ICON_SMALL, 0));
+ Window_FreeIcon_IcoLib(m_hwnd);
}
void CVkWallPostForm::On_btnShare_Click(CCtrlButton*)
diff --git a/protocols/Yahoo/src/chat.cpp b/protocols/Yahoo/src/chat.cpp
index f80fa58e97..6071675b01 100644
--- a/protocols/Yahoo/src/chat.cpp
+++ b/protocols/Yahoo/src/chat.cpp
@@ -423,8 +423,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
param = (InviteChatParam*)lParam;
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)param->ppro->LoadIconEx("yahoo", true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)param->ppro->LoadIconEx("yahoo"));
+ Window_SetIcon_IcoLib(hwndDlg, param->ppro->GetIconHandle(IDI_YAHOO));
SetDlgItemTextA(hwndDlg, IDC_ROOMNAME, param->room);
SetDlgItemText(hwndDlg, IDC_MSG, TranslateT("Join My Conference..."));
@@ -435,8 +434,7 @@ INT_PTR CALLBACK InviteToChatDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPAR
break;
case WM_NCDESTROY:
- param->ppro->ReleaseIconEx("yahoo", true);
- param->ppro->ReleaseIconEx("yahoo");
+ Window_FreeIcon_IcoLib(hwndDlg);
delete param;
break;
@@ -516,8 +514,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
param = (InviteChatReqParam*)lParam;
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)param->ppro->LoadIconEx("yahoo", true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)param->ppro->LoadIconEx("yahoo"));
+ Window_SetIcon_IcoLib(hwndDlg, param->ppro->GetIconHandle(IDI_YAHOO));
SetDlgItemTextA(hwndDlg, IDC_SCREENNAME, param->who);
SetDlgItemText(hwndDlg, IDC_MSG, param->msg);
@@ -529,8 +526,7 @@ INT_PTR CALLBACK ChatRequestDialog(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
break;
case WM_NCDESTROY:
- param->ppro->ReleaseIconEx("yahoo", true);
- param->ppro->ReleaseIconEx("yahoo");
+ Window_FreeIcon_IcoLib(hwndDlg);
delete param;
break;
diff --git a/protocols/Yahoo/src/services.cpp b/protocols/Yahoo/src/services.cpp
index 7e25b7c459..9e4635ab47 100644
--- a/protocols/Yahoo/src/services.cpp
+++ b/protocols/Yahoo/src/services.cpp
@@ -120,8 +120,7 @@ static INT_PTR CALLBACK DlgProcSetCustStat(HWND hwndDlg, UINT msg, WPARAM wParam
CYahooProto* ppro = (CYahooProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)ppro->LoadIconEx("yahoo", true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)ppro->LoadIconEx("yahoo"));
+ Window_SetIcon_IcoLib(hwndDlg, ppro->GetIconHandle(IDI_YAHOO));
if (!ppro->getString(YAHOO_CUSTSTATDB, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_CUSTSTAT, dbv.pszVal);
@@ -185,11 +184,7 @@ static INT_PTR CALLBACK DlgProcSetCustStat(HWND hwndDlg, UINT msg, WPARAM wParam
break;
case WM_DESTROY:
- {
- CYahooProto* ppro = (CYahooProto*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- ppro->ReleaseIconEx("yahoo", true);
- ppro->ReleaseIconEx("yahoo");
- }
+ Window_FreeIcon_IcoLib(hwndDlg);
break;
}
return FALSE;
diff --git a/protocols/Yahoo/src/stdafx.h b/protocols/Yahoo/src/stdafx.h
index 1a15b46d58..cd3dc79f7d 100644
--- a/protocols/Yahoo/src/stdafx.h
+++ b/protocols/Yahoo/src/stdafx.h
@@ -39,6 +39,7 @@
#include <m_database.h>
#include <m_netlib.h>
#include <m_idle.h>
+#include <m_icolib.h>
#include <m_clist.h>
#include <m_protosvc.h>
#include <m_protoint.h>
diff --git a/protocols/Yahoo/src/user_info.cpp b/protocols/Yahoo/src/user_info.cpp
index a6a8c89f1a..016053a9ad 100644
--- a/protocols/Yahoo/src/user_info.cpp
+++ b/protocols/Yahoo/src/user_info.cpp
@@ -27,10 +27,6 @@ static INT_PTR CALLBACK YahooUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPA
case WM_INITDIALOG:
// lParam is hContact
TranslateDialogDefault(hwndDlg);
-
- //SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_USERDETAILS));
-
-
break;
case WM_NOTIFY: