diff options
Diffstat (limited to 'justtabs/win.cpp')
-rw-r--r-- | justtabs/win.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
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;
|