How to pass Ctrl+C to the background application in vb .net?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, All,

I have a vb .net program that starts a process in the background and I
wondered whether it is possible to pass Ctrl+C to interrupt (not to kill) the
background process. I know the background application was written in C and
used SIGINT to handle the interrupt. I am at a loss about how to pass the
interrupt in my vb .net program.

Any information would be greatly appreciated.

Thanks

Alison
 
Hi, Alison.
Yes, you can use the SendKeys class. Either the sendwait method, which
wll wait for a return value, or the send method which will not. The key
string you need to send is "^C".

Alt = %
Ctrl = ^
Shift = +


Tom
 
Thank you Tom for the reply.

My problem is I wondered if I can use sendkeys to send certain keystrokes
(Ctrl+C) to a backgound application (which has no active window) so that I
can interrupt its running. Since there is no active window present with the
background application, I am not sure about how to do it.

Thanks for your time and help.
Alison
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top