dotnet / dotnet/dotnet-api-docs

The CloseReason.TaskManagerClosing description is no longer accurate.

Open
#5,445 1 comment 0 reactions 0 assignees View on GitHub
area-WinForms Pri3 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

TL;DR: The name and the description are no longer accurate because the task manager no longer triggers that close reason.

It appears that as of Windows 8.1, task manager no longer sends the WM_CLOSE message. According to a question/answer on stack overflow, the new task manager does not use WM_CLOSE anymore. It either uses just TerminateProcess() or a "UserClosing" and a TerminateProcess() after a timeout. At any rate, CloseReason.TaskManagerClosing could be triggered by anything.

It appears, rather, that the CloseReason.TaskManagerClosing is set as the close reason when the window receives a WM_CLOSE message (0x10), which could originate from any process on the system, and not necessarily Task Manager. - StackOverflow User drf

https://stackoverflow.com/questions/6880329/net-forms-keep-disappearing-due-to-taskmanagerclosing

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Windows.Forms/CloseReason.xml

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.