From 6dfc36b35413c01e861ea75cfc8a3aa489c91c3c Mon Sep 17 00:00:00 2001 From: sje Date: Tue, 21 Nov 2006 23:14:20 +0000 Subject: close tabs in reverse order (for e.g. 'last contact') git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@53 4f64403b-2f21-0410-a795-97e2b3489a10 --- justtabs/win.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'justtabs/win.cpp') diff --git a/justtabs/win.cpp b/justtabs/win.cpp index b4a0461..e2f286c 100644 --- a/justtabs/win.cpp +++ b/justtabs/win.cpp @@ -336,7 +336,21 @@ BOOL CALLBACK FrameProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { Utils_SaveWindowPosition(hwnd, 0, MODULE, "MainWin"); active_window = 0; SetFocus(tab_ctrl); // crash if focus is in typing window when srmm closed (EN_KILLFOCUS command, null dat) - WindowList_Broadcast(window_list, WM_CLOSE, 0, 0); + + // clost windows in reverse order (for e.g. 'last contact') + int l, i; + HWND hwndMsg; + TCITEM tci; + l = TabCtrl_GetItemCount(tab_ctrl); + for (i = l - 1; i >= 0; --i) { + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(tab_ctrl, i, &tci); + hwndMsg = ((TabData *)tci.lParam)->hwndMsg; + + SendMessage(hwndMsg, WM_CLOSE, 0, 0); + } + //WindowList_Broadcast(window_list, WM_CLOSE, 0, 0); + ShowWindow(hwnd, SW_HIDE); } return TRUE; -- cgit v1.2.3