Skip to content

Commit 0add8ea

Browse files
committed
updated CloseDebugWindow()
1 parent 3a97512 commit 0add8ea

File tree

1 file changed

+7
-28
lines changed

1 file changed

+7
-28
lines changed

src/MultiReplacePanel.cpp

Lines changed: 7 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5947,44 +5947,23 @@ void MultiReplace::CopyListViewToClipboard(HWND hListView) {
59475947
}
59485948
}
59495949

5950-
void MultiReplace::CloseDebugWindow() {
5951-
// Triggers the WM_CLOSE message for the debug window, handled in DebugWindowProc
5952-
if (hDebugWnd != NULL) {
5953-
// Save the window position and size before closing
5954-
RECT rect;
5955-
if (GetWindowRect(hDebugWnd, &rect)) {
5956-
debugWindowPosition.x = rect.left;
5957-
debugWindowPosition.y = rect.top;
5958-
debugWindowPositionSet = true;
5959-
5960-
debugWindowSize.cx = rect.right - rect.left;
5961-
debugWindowSize.cy = rect.bottom - rect.top;
5962-
debugWindowSizeSet = true;
5963-
}
5964-
5965-
PostMessage(hDebugWnd, WM_CLOSE, 0, 0);
5966-
}
5967-
}
5968-
/*
59695950
void MultiReplace::CloseDebugWindow()
59705951
{
5971-
if (!hDebugWnd) return; // nothing to do
5952+
// Triggers the WM_CLOSE message for the debug window, handled in DebugWindowProc
5953+
if (!IsWindow(hDebugWnd)) {
5954+
return;
5955+
}
59725956

5973-
// save last pos/size (unchanged) ...
5957+
// Save the window position and size before closing
59745958
RECT rc;
5975-
if (GetWindowRect(hDebugWnd, &rc))
5976-
{
5959+
if (GetWindowRect(hDebugWnd, &rc)) {
59775960
debugWindowPosition = { rc.left, rc.top };
59785961
debugWindowSize = { rc.right - rc.left, rc.bottom - rc.top };
59795962
debugWindowPositionSet = debugWindowSizeSet = true;
59805963
}
59815964

5982-
HWND hwnd = hDebugWnd;
5983-
hDebugWnd = NULL; // mark as closed *before* sending
5984-
5985-
SendMessage(hwnd, WM_CLOSE, 0, 0); // synchronous → window really gone
5965+
SendMessage(hDebugWnd, WM_CLOSE, 0, 0); // synchronous → window really gone
59865966
}
5987-
*/
59885967

59895968
#pragma endregion
59905969

0 commit comments

Comments
 (0)