@@ -5947,44 +5947,23 @@ void MultiReplace::CopyListViewToClipboard(HWND hListView) {
5947
5947
}
5948
5948
}
5949
5949
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
- /*
5969
5950
void MultiReplace::CloseDebugWindow ()
5970
5951
{
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
+ }
5972
5956
5973
- // save last pos/ size (unchanged) ...
5957
+ // Save the window position and size before closing
5974
5958
RECT rc;
5975
- if (GetWindowRect(hDebugWnd, &rc))
5976
- {
5959
+ if (GetWindowRect (hDebugWnd, &rc)) {
5977
5960
debugWindowPosition = { rc.left , rc.top };
5978
5961
debugWindowSize = { rc.right - rc.left , rc.bottom - rc.top };
5979
5962
debugWindowPositionSet = debugWindowSizeSet = true ;
5980
5963
}
5981
5964
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
5986
5966
}
5987
- */
5988
5967
5989
5968
#pragma endregion
5990
5969
0 commit comments