When Windows' Task Scheduler ends as task (either because the task exceeded the
stop the task if it runs longer than timeout or because a user right-clicked on it and chose 'End'), what happens behind-the-scenes? Is a WM_CLOSE message sent to the task's executable? Is the OS asked to kill the task?
The fact that a task can be configured to
if the running task does not end when requested, force it to stop (Task Properties, Settings tab) makes me think that first Task Scheduler sends a 'hey, I'd like you to close' message (like WM_CLOSE) to the executing task, then, if that message isn't acted on in a timely manner and if the 'force stop' option is configured, the OS is asked to kill the process.
I haven't been able to find documentation on this.