From eec361608fde60d63fe4511e26e3b95c7f72be13 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 5 Jun 2016 16:11:08 +0000 Subject: - fix for #1059; - direct unsafe work with icons replaces with Window_SetIcon_IcoLib / Window_SetSkinIcon_IcoLib; - code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@16917 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Yahoo/src/chat.cpp | 12 ++++-------- protocols/Yahoo/src/services.cpp | 9 ++------- protocols/Yahoo/src/stdafx.h | 1 + protocols/Yahoo/src/user_info.cpp | 4 ---- 4 files changed, 7 insertions(+), 19 deletions(-) (limited to 'protocols/Yahoo') 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 #include #include +#include #include #include #include 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: -- cgit v1.2.3