Closed zenflow closed 3 years ago
Adds GenerateConsoleCtrlEvent to the Kernel32 library. This is useful for sending ctrl+c signal to all processes attached to the current console, causing their SIGINT event handlers to fire, causing them to exit gracefully (i.e. after cleaning up if necessary). Some related discussion: https://github.com/nodejs/node/issues/35172#issuecomment-691624790
SIGINT
In the linked documentation (under "Parameters") we see that the dwCtrlEvent parameter uses an enumeration:
dwCtrlEvent
CTRL_C_EVENT
0
CTRL_BREAK_EVENT
1
Is there some way we should include this enumeration in this library?
For now it is possible to just use the number value.
/cc @waitingsong and thanks for the awesome library ❤️
Hi, you can add constans of knl32 here : https://github.com/waitingsong/node-win32-api/blob/master/packages/win32-api/src/lib/kernel32/constants.ts
Adds GenerateConsoleCtrlEvent to the Kernel32 library. This is useful for sending ctrl+c signal to all processes attached to the current console, causing their
SIGINT
event handlers to fire, causing them to exit gracefully (i.e. after cleaning up if necessary). Some related discussion: https://github.com/nodejs/node/issues/35172#issuecomment-691624790In the linked documentation (under "Parameters") we see that the
dwCtrlEvent
parameter uses an enumeration:CTRL_C_EVENT
is0
CTRL_BREAK_EVENT
is1
Is there some way we should include this enumeration in this library?
For now it is possible to just use the number value.
/cc @waitingsong and thanks for the awesome library ❤️