summaryrefslogtreecommitdiff
path: root/src/core
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 /src/core
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 'src/core')
-rw-r--r--src/core/stdchat/src/options.cpp7
-rw-r--r--src/core/stdchat/src/stdafx.h1
-rw-r--r--src/core/stdchat/src/window.cpp3
-rw-r--r--src/core/stdfile/src/filerecvdlg.cpp2
-rw-r--r--src/core/stdfile/src/filesenddlg.cpp2
-rw-r--r--src/core/stdfile/src/ftmanager.cpp2
-rw-r--r--src/core/stdhelp/src/about.cpp2
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp6
-rw-r--r--src/core/stdmsg/src/msgs.h1
-rw-r--r--src/core/stdmsg/src/msgtimedout.cpp4
-rw-r--r--src/core/stduihist/src/history.cpp2
-rw-r--r--src/core/stduserinfo/src/userinfo.cpp2
12 files changed, 19 insertions, 15 deletions
diff --git a/src/core/stdchat/src/options.cpp b/src/core/stdchat/src/options.cpp
index a3abd05109..b5ddfdc7d4 100644
--- a/src/core/stdchat/src/options.cpp
+++ b/src/core/stdchat/src/options.cpp
@@ -313,6 +313,13 @@ HICON LoadIconEx(const char *pszIcoLibName, bool big)
return IcoLib_GetIcon(szTemp, big);
}
+HANDLE GetIconHandle(const char *pszIcoLibName)
+{
+ char szTemp[256];
+ mir_snprintf(szTemp, "chat_%s", pszIcoLibName);
+ return IcoLib_GetIconHandle(szTemp);
+}
+
static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
diff --git a/src/core/stdchat/src/stdafx.h b/src/core/stdchat/src/stdafx.h
index ec6be80973..5acc72626b 100644
--- a/src/core/stdchat/src/stdafx.h
+++ b/src/core/stdchat/src/stdafx.h
@@ -149,6 +149,7 @@ SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si);
int OptionsInitialize(WPARAM wParam, LPARAM lParam);
void AddIcons(void);
HICON LoadIconEx(const char *pszIcoLibName, bool big);
+HANDLE GetIconHandle(const char *pszIcolibName);
// services.c
void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground);
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp
index 00abe9297a..eff7d1c9bd 100644
--- a/src/core/stdchat/src/window.cpp
+++ b/src/core/stdchat/src/window.cpp
@@ -1268,8 +1268,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SendMessage(hwndDlg, GC_FIXTABICONS, 0, 0);
SendMessage(si->hwndStatus, SB_SETICON, 0, (LPARAM)hIcon);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)LoadIconEx("window", TRUE));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIconEx("window", FALSE));
+ Window_SetIcon_IcoLib(hwndDlg, GetIconHandle("window"));
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground);
diff --git a/src/core/stdfile/src/filerecvdlg.cpp b/src/core/stdfile/src/filerecvdlg.cpp
index 47254f5499..cbed678e37 100644
--- a/src/core/stdfile/src/filerecvdlg.cpp
+++ b/src/core/stdfile/src/filerecvdlg.cpp
@@ -197,7 +197,7 @@ INT_PTR CALLBACK DlgProcRecvFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
- Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_ADD, SKINICON_OTHER_ADDCONTACT, LPGEN("Add contact permanently to list"));
Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));
diff --git a/src/core/stdfile/src/filesenddlg.cpp b/src/core/stdfile/src/filesenddlg.cpp
index 2a5d28c7ef..54c6a9a786 100644
--- a/src/core/stdfile/src/filesenddlg.cpp
+++ b/src/core/stdfile/src/filesenddlg.cpp
@@ -218,7 +218,7 @@ INT_PTR CALLBACK DlgProcSendFile(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
EnumChildWindows(hwndDlg, ClipSiblingsChildEnumProc, 0);
mir_subclassWindow(GetDlgItem(hwndDlg, IDC_MSG), SendEditSubclassProc);
- Window_SetIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_EVENT_FILE);
Button_SetIcon_IcoLib(hwndDlg, IDC_DETAILS, SKINICON_OTHER_USERDETAILS, LPGEN("View user's details"));
Button_SetIcon_IcoLib(hwndDlg, IDC_HISTORY, SKINICON_OTHER_HISTORY, LPGEN("View user's history"));
Button_SetIcon_IcoLib(hwndDlg, IDC_USERMENU, SKINICON_OTHER_DOWNARROW, LPGEN("User menu"));
diff --git a/src/core/stdfile/src/ftmanager.cpp b/src/core/stdfile/src/ftmanager.cpp
index f5e42cb3d9..12548bab1e 100644
--- a/src/core/stdfile/src/ftmanager.cpp
+++ b/src/core/stdfile/src/ftmanager.cpp
@@ -268,7 +268,7 @@ static INT_PTR CALLBACK FtMgrDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HWND hwndTab = GetDlgItem(hwnd, IDC_TABS);
TranslateDialogDefault(hwnd);
- Window_SetIcon_IcoLib(hwnd, SKINICON_EVENT_FILE);
+ Window_SetSkinIcon_IcoLib(hwnd, SKINICON_EVENT_FILE);
dat = (struct TFtMgrData *)mir_calloc(sizeof(struct TFtMgrData));
diff --git a/src/core/stdhelp/src/about.cpp b/src/core/stdhelp/src/about.cpp
index 1f96c32d13..d7f21012bf 100644
--- a/src/core/stdhelp/src/about.cpp
+++ b/src/core/stdhelp/src/about.cpp
@@ -77,7 +77,7 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
}
FreeResource(hRes);
}
- Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_MIRANDA);
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_OTHER_MIRANDA);
return TRUE;
case WM_COMMAND:
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 22bf436713..9e43d2cf48 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -909,13 +909,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
if (dat->szProto) {
WORD wStatus = db_get_w(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadProtoIcon(dat->szProto, wStatus, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadProtoIcon(dat->szProto, wStatus));
+ Window_SetProtoIcon_IcoLib(hwndDlg, dat->szProto, wStatus);
break;
}
}
- SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true));
- SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_EVENT_MESSAGE);
break;
case DM_USERNAMETOCLIP:
diff --git a/src/core/stdmsg/src/msgs.h b/src/core/stdmsg/src/msgs.h
index 31a1c643cf..ac5c99a003 100644
--- a/src/core/stdmsg/src/msgs.h
+++ b/src/core/stdmsg/src/msgs.h
@@ -127,6 +127,7 @@ int DbEventIsForMsgWindow(DBEVENTINFO *dbei);
int DbEventIsShown(DBEVENTINFO *dbei);
void StreamInEvents(HWND hwndDlg, MEVENT hDbEventFirst, int count, int fAppend);
int SendMessageDirect(const TCHAR *szMsg, MCONTACT hContact, char *szProto);
+INT_PTR SendMessageCmd(MCONTACT hContact, char *msg, int isWchar);
void LoadMsgLogIcons(void);
void FreeMsgLogIcons(void);
diff --git a/src/core/stdmsg/src/msgtimedout.cpp b/src/core/stdmsg/src/msgtimedout.cpp
index 187bc43f41..0f3d4ac508 100644
--- a/src/core/stdmsg/src/msgtimedout.cpp
+++ b/src/core/stdmsg/src/msgtimedout.cpp
@@ -28,9 +28,7 @@ struct ErrorDlgParam
TMsgQueue *item;
};
-INT_PTR SendMessageCmd(MCONTACT hContact, char* msg, int isWchar);
-
-static INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+INT_PTR CALLBACK ErrorDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
TMsgQueue *item = (TMsgQueue*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
diff --git a/src/core/stduihist/src/history.cpp b/src/core/stduihist/src/history.cpp
index 16d78a9144..f1e6b26602 100644
--- a/src/core/stduihist/src/history.cpp
+++ b/src/core/stduihist/src/history.cpp
@@ -211,7 +211,7 @@ static INT_PTR CALLBACK DlgProcHistory(HWND hwndDlg, UINT msg, WPARAM wParam, LP
mir_sntprintf(str, TranslateT("History for %s"), contactName);
SetWindowText(hwndDlg, str);
}
- Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_HISTORY);
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_OTHER_HISTORY);
SendMessage(hwndDlg, DM_HREBUILD, 0, 0);
return TRUE;
diff --git a/src/core/stduserinfo/src/userinfo.cpp b/src/core/stduserinfo/src/userinfo.cpp
index 947112d355..23009dcaa5 100644
--- a/src/core/stduserinfo/src/userinfo.cpp
+++ b/src/core/stduserinfo/src/userinfo.cpp
@@ -238,7 +238,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- Window_SetIcon_IcoLib(hwndDlg, SKINICON_OTHER_USERDETAILS);
+ Window_SetSkinIcon_IcoLib(hwndDlg, SKINICON_OTHER_USERDETAILS);
{
PROPSHEETHEADER *psh = (PROPSHEETHEADER*)lParam;
dat = (DetailsData*)mir_calloc(sizeof(DetailsData));