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/IcqOscarJ/src/icq_firstrun.cpp | 6 ++---- protocols/IcqOscarJ/src/icq_xstatus.cpp | 6 ++---- protocols/IcqOscarJ/src/loginpassword.cpp | 6 ++---- 3 files changed, 6 insertions(+), 12 deletions(-) (limited to 'protocols/IcqOscarJ') 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: -- cgit v1.2.3