alexsilva / supervisor

Supervisor process control system for Windows
http://supervisord.org
Other
118 stars 26 forks source link

Added support for sending window events to managed processes. #30

Closed philipstarkey closed 3 years ago

philipstarkey commented 3 years ago

This resolves #26

The stopsignal config option now supports Windows window events such as WM_CLOSE (and other events prefixed with WM_). These can also be specified using the negative of the event integer (negative numbers used to distinguish them from standard signals without having to introduce complex code into supervisor). For example, -16 corresponds to WM_CLOSE. This allows custom user events (see WM_USER win32 documentation)

philipstarkey commented 3 years ago

@alexsilva I figured after learning about signals in the last few days I'd take a stab at doing #26 while I still remembered everything. Seems to work when run from command line and as a service (although Windows does not permit users to interact with graphical applications launched as services, but they still run and can receive the window events).

Haven't written any additional tests...wasn't sure if I should or what should be tested.

Hope this is useful. Let me know if you'd like any changes.

alexsilva commented 3 years ago

Looks good. I just put some observations on what could be changed before the merge. An excellent thing is the documentation and I should be doing that too.