Skip to content

/SUBSYSTEM:WINDOWS Win32 application attaching to parent console and closing on CTRL-C/CTRL-BREAK

Notifications You must be signed in to change notification settings

collinstevens/win32-ctrl-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Demonstrate an application on Windows using /SUBSYSTEM:WINDOWS which is spawned from the command line and then closed from the command line by CTRL-C or CTRL-BREAK.

See https://learn.microsoft.com/en-us/windows/console/setconsolectrlhandler for registering the pseudo "Console" message pump to process CTRL-* events.

See https://learn.microsoft.com/en-us/windows/console/handlerroutine for the details of the message pump routine.

Not used here, but see https://learn.microsoft.com/en-us/windows/console/generateconsolectrlevent for an example of sending CTRL-* events to process groups.

See https://learn.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program to create a Win32 application.

Inspired by electron/electron#5273.

About

/SUBSYSTEM:WINDOWS Win32 application attaching to parent console and closing on CTRL-C/CTRL-BREAK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published