0

Possible Duplicate:
Can I send a ctrl-C (SIGINT) to an application on Windows?
How to effectively kill a process in C++ (Win32)?
C++ Sending a simple signal in Windows

I have a java console application, this application starts to shutdown when I press CTRLC. Could you please tell me, how I can simulate pressing CTRLC from my C++ application if I know only pid and have process handle?

As I understood, I must send SIGINT signal to process, how can I do it?

p.s. Solutions on SO are not working!

Thanks!

Community
  • 1
  • 1
KuperMuper
  • 49
  • 2
  • 6

2 Answers2

1

On posix by using

kill(pid, SIGINT);
pmr
  • 58,701
  • 10
  • 113
  • 156
0

You can use kill for that. You need the process id (pid) of your java application

pid_t java_app;
kill(java_app, SIGINT);
Olaf Dietsche
  • 72,253
  • 8
  • 102
  • 198