From 0f37fbfbfe24563a6be07f9abd245374e66cb173 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 19 Sep 2016 12:27:44 +0000 Subject: chat code reordering git-svn-id: http://svn.miranda-ng.org/main/trunk@17317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/core/stdchat/src/manager.cpp | 11 +++++++++++ src/core/stdchat/src/services.cpp | 2 +- src/core/stdchat/src/stdafx.h | 1 + src/core/stdchat/src/window.cpp | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/stdchat/src/manager.cpp b/src/core/stdchat/src/manager.cpp index 069e2230a9..1132c7e875 100644 --- a/src/core/stdchat/src/manager.cpp +++ b/src/core/stdchat/src/manager.cpp @@ -24,6 +24,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. TABLIST *g_TabList = 0; +BOOL SM_SetTabbedWindowHwnd(SESSION_INFO *si, HWND hwnd) +{ + for (SESSION_INFO *p = pci->wndList; p != NULL; p = p->next) { + if (si && si == p) + p->hWnd = hwnd; + else + p->hWnd = NULL; + } + return TRUE; +} + SESSION_INFO* SM_GetPrevWindow(SESSION_INFO *si) { if (!si) diff --git a/src/core/stdchat/src/services.cpp b/src/core/stdchat/src/services.cpp index f534c4a56c..5fe0c9c70e 100644 --- a/src/core/stdchat/src/services.cpp +++ b/src/core/stdchat/src/services.cpp @@ -61,7 +61,7 @@ void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground) // if the session was not the current tab we need to tell the window to // redraw to show the contents of the current SESSION_INFO if (!si->hWnd) { - pci->SM_SetTabbedWindowHwnd(si, g_TabSession.hWnd); + SM_SetTabbedWindowHwnd(si, g_TabSession.hWnd); SendMessage(g_TabSession.hWnd, GC_ADDTAB, -1, (LPARAM)si); SendMessage(g_TabSession.hWnd, GC_TABCHANGE, 0, (LPARAM)&g_TabSession); } diff --git a/src/core/stdchat/src/stdafx.h b/src/core/stdchat/src/stdafx.h index 5e27b6b467..a5c90861a1 100644 --- a/src/core/stdchat/src/stdafx.h +++ b/src/core/stdchat/src/stdafx.h @@ -142,6 +142,7 @@ char* Log_CreateRtfHeader(MODULEINFO * mi); INT_PTR CALLBACK RoomWndProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam); int GetTextPixelSize( wchar_t* pszText, HFONT hFont, BOOL bWidth); +BOOL SM_SetTabbedWindowHwnd(SESSION_INFO *si, HWND hwnd); SESSION_INFO* SM_GetPrevWindow(SESSION_INFO *si); SESSION_INFO* SM_GetNextWindow(SESSION_INFO *si); diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index cd6be436d8..5f18af8b47 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -2590,7 +2590,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar case GC_CLOSEWINDOW: if (g_Settings.bTabsEnable) - pci->SM_SetTabbedWindowHwnd(0, 0); + SM_SetTabbedWindowHwnd(0, 0); DestroyWindow(hwndDlg); break; -- cgit v1.2.3