Skip to content

Process(windows): try sending WM_CLOSE for graceful process termination #13108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

takase1121
Copy link
Contributor

The problem
Windows. Windows is the problem.
#8129

This PR takes the QT method of sending WM_CLOSE to all application window, then send WM_CLOSE to the main thread of the child process.

Description

Windows always makes things more complicated.
On Windows, there are multiple ways to gracefully terminate a process.

  1. Send WM_CLOSE to a Window.
  2. Send Ctrl+Break event with GenerateConsoleCtrlEvent.

None of these two ways cover all applications - WM_CLOSE only works when the program has a message loop like in GUI programs, GenerateConsoleCtrlEvent has quirks.

Existing Issue(s)

@slouken slouken added this to the 3.4.0 milestone May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants