summaryrefslogtreecommitdiff
path: root/protocols/AimOscar
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-06-05 16:11:08 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-06-05 16:11:08 +0000
commiteec361608fde60d63fe4511e26e3b95c7f72be13 (patch)
tree0263d1829438c7778a713ee2ae6bbda27c0d260a /protocols/AimOscar
parent7e822f45eccd034e7acd8d868ce5dc8c55458ff0 (diff)
- 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
Diffstat (limited to 'protocols/AimOscar')
-rw-r--r--protocols/AimOscar/src/theme.cpp22
-rw-r--r--protocols/AimOscar/src/theme.h2
-rwxr-xr-xprotocols/AimOscar/src/ui.cpp9
3 files changed, 13 insertions, 20 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);