Change: Hide client chat dialog on close instead of terminating
Closing the client-side chat dialog (via the "end chat" button or the title-bar X) now only hides the window and keeps the session alive, instead of destroying it. Closing the chat stays server-initiated: the next message from the server reopens the hidden dialog via the existing SW_RESTORE path in OnReceive, and the dialog is only truly destroyed on COMMAND_CHAT_CLOSE or connection close. Co-Authored-By: deepseek-v4-pro
This commit is contained in:
1 parent
d15cd77a28
commit
ca6f76565c
1 file changed
+6
-3
@@ -245,14 +245,17 @@ INT_PTR CALLBACK CChatManager::ChatDialogProc(HWND hDlg, UINT uMsg, WPARAM wPara
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
if (LOWORD(wParam) == IDC_BUTTON_END) {
|
if (LOWORD(wParam) == IDC_BUTTON_END) {
|
||||||
// 被控端主动结束交谈:关闭本地聊天窗口
|
// 被控端关闭聊天窗口:仅隐藏对话框,会话保持。关闭交谈始终由服务端发起,
|
||||||
SendMessage(hDlg, WM_USER + 1, NULL, NULL);
|
// 服务端继续发消息时 OnReceive 会用 SW_RESTORE 重新弹出本对话框。
|
||||||
|
ShowWindow(hDlg, SW_HIDE);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
return 0;
|
// X 关闭按钮:仅隐藏对话框(与「结束交谈」一致),关闭交谈始终由服务端发起
|
||||||
|
ShowWindow(hDlg, SW_HIDE);
|
||||||
|
return TRUE;
|
||||||
|
|
||||||
case WM_USER + 1:
|
case WM_USER + 1:
|
||||||
pThis->m_hWnd = NULL;
|
pThis->m_hWnd = NULL;
|
||||||
|
|||||||
Reference in new issue
Block a user