[python-win32] Control-C
Sean Q. Hendricks
shendric at uga.edu
Fri Oct 14 17:30:43 CEST 2005
Mark Hammond wrote:
>Sadly, I think GenerateConsoleCtrlEvent will not work for you. In short, it
>is nearly useless :) The description of the function says it "sends a
>specified signal to a console process group that shares the console
>associated with the calling process" and it means it literally. In your
>case, it sounds like you have a GUI program, so that will not have a
>console, so will never be able to be part of your process group. If the
>running program is not in the exact same console as your app, you are hosed.
>
>More info on this can be found at
>http://www.microsoft.com/msj/0698/win320698.aspx, where they describe a
>technique where they need to use another child process to make this work -
>but even then its not clear it would work if you app is a GUI one.
>
>
Thank you for the link. I'll check it out. I hadn't had the chance to
try the GenerateConsoleCtrlEvent yet.
>hrm - re-reading your message above, it sounds like the child process *is* a
>console process. Either way, the above should get you in the right
>direction.
>
>
In this case, yes, the child process is a console process, since it's a
commandline application. It turns out that the application comes with
another program attached that may do what I need, but I'm going to look
at the link you provided, just in case. Thanks a bunch.
Sean
More information about the Python-win32
mailing list