diff options
-rw-r--r-- | protocols/JabberG/src/jabber_icolib.cpp | 5 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_menu.cpp | 4 | ||||
-rw-r--r-- | protocols/JabberG/src/jabber_proto.cpp | 4 | ||||
-rw-r--r-- | src/modules/protocols/protoopts.cpp | 9 |
4 files changed, 9 insertions, 13 deletions
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 9afd1e3950..71bfea3dc6 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -186,13 +186,10 @@ void CJabberProto::IconsInit(void) HANDLE CJabberProto::GetIconHandle(int iconId)
{
- if (HANDLE result = g_GetIconHandle(iconId))
- return result;
-
if (iconId == IDI_JABBER)
return m_hProtoIcon;
- return NULL;
+ return g_GetIconHandle(iconId);
}
HICON CJabberProto::LoadIconEx(const char* name, bool big)
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 02d8171b3b..3f78cbb360 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -436,7 +436,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON|CMIM_FLAGS;
- mi.icolibItem = GetIconHandle(IDI_JABBER);
+ mi.icolibItem = m_hProtoIcon;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuResourcesRoot, (LPARAM)&mi);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hMenuResourcesActive, (LPARAM)&mi);
@@ -690,7 +690,7 @@ void CJabberProto::MenuInit() mi.position = -1999901006;
mi.hParentMenu = HGENMENU_ROOT;
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTPOPUP | CMIF_TCHAR | CMIF_KEEPUNTRANSLATED;
- mi.icolibItem = GetIconHandle(IDI_JABBER);
+ mi.icolibItem = m_hProtoIcon;
hJabberRoot = m_hMenuRoot = Menu_AddProtoMenuItem(&mi);
}
else {
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 9ad0e24675..520c0b9954 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -711,10 +711,10 @@ HICON __cdecl CJabberProto::GetIcon(int iconIndex) {
if (LOWORD(iconIndex) == PLI_PROTOCOL) {
if (iconIndex & PLIF_ICOLIBHANDLE)
- return (HICON)GetIconHandle(IDI_JABBER);
+ return (HICON)m_hProtoIcon;
bool big = (iconIndex & PLIF_SMALL) == 0;
- HICON hIcon = LoadIconEx("main", big);
+ HICON hIcon = Skin_GetIconByHandle(m_hProtoIcon, big);
if (iconIndex & PLIF_ICOLIB)
return hIcon;
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp index 636a316222..80471da93f 100644 --- a/src/modules/protocols/protoopts.cpp +++ b/src/modules/protocols/protoopts.cpp @@ -547,9 +547,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM case WM_DRAWITEM:
{
- int tmp, size, length;
+ int tmp;
TCHAR *text;
- HICON hIcon;
HBRUSH hbrBack;
SIZE sz;
@@ -584,7 +583,7 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM else
tmp = acc->bIsEnabled ? SKINICON_OTHER_TICK : SKINICON_OTHER_NOTICK;
- hIcon = LoadSkinnedIcon(tmp);
+ HICON hIcon = LoadSkinnedIcon(tmp);
DrawIconEx(lps->hDC, lps->rcItem.left, lps->rcItem.top, hIcon, cxIcon, cyIcon, 0, hbrBack, DI_NORMAL);
IcoLib_ReleaseIcon(hIcon, 0);
@@ -597,8 +596,8 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM }
lps->rcItem.left += cxIcon + 2;
- length = SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXTLEN, lps->itemID, 0);
- size = max(length+1, 256);
+ int length = SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXTLEN, lps->itemID, 0);
+ int size = max(length+1, 256);
text = (TCHAR *)_alloca(sizeof(TCHAR) * size);
SendDlgItemMessage(hwndDlg, IDC_ACCLIST, LB_GETTEXT, lps->itemID, (LPARAM)text);
|