![]() |
How to send Cntrol C to another running application
Hi,
I am trying to write a C code on windows to send cntrol C signal to a running, so that the running application closes gracefully. Here is the code I have tried to write: Code:
#include<stdio.h>Waiting for a quick response. Regards. |
Re: How to send Cntrol C to another running application
Ctrl-C doesn't kill Windows programs. You could try using TaskKill instead http://technet.microsoft.com/en-us/l.../bb491009.aspx
Or if you want to do it programmatically you could try sending WM_CLOSE to the main window, but the behaviour will depend on what the application does with that message. |
Re: How to send Cntrol C to another running application
Hi thanks for da reply.
But the second application closes gracefully only if it receives SIGINT signal(Generated by cntrol C). Taskkill will forceully kill the application without gracefully closing it. Please guide something related to this. |
Re: How to send Cntrol C to another running application
What if you send the Ctrl-C to the DOS box it's running in rather than sending it to the executable?
|
Re: How to send Cntrol C to another running application
Please guide how to work on that.
|
Re: How to send Cntrol C to another running application
Tried it; doesn't work. GenerateConsoleCtrlEvent looks like it might be a possibility.
|
| All times are GMT +5.5. The time now is 00:52. |