F
F.C.
Hi code gurus !
I'm creating a front end for a DOS application using VB .Net. I launch this
DOS app using System.Diagnostics.Process :
myProcess.StartInfo.FileName = "myapp.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()
I want to send a CTRL-C event to the DOS app, since it's the only way to
interrupt it (unfortunately I'm not the author so I can't change this).
I tried to send a CTRL-C event using the "ConsoleCtrlEvent" API, with no
success. I tried both :
GenerateConsoleCtrlEvent(ConsoleCtrlEvent.CTRL_C, 0)
and
GenerateConsoleCtrlEvent(ConsoleCtrlEvent.CTRL_C, myprocess.id)
But none of them seems to work.
So if someone can help me, I'd be very grateful.
Thank you in advance !
F.C
I'm creating a front end for a DOS application using VB .Net. I launch this
DOS app using System.Diagnostics.Process :
myProcess.StartInfo.FileName = "myapp.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.Start()
I want to send a CTRL-C event to the DOS app, since it's the only way to
interrupt it (unfortunately I'm not the author so I can't change this).
I tried to send a CTRL-C event using the "ConsoleCtrlEvent" API, with no
success. I tried both :
GenerateConsoleCtrlEvent(ConsoleCtrlEvent.CTRL_C, 0)
and
GenerateConsoleCtrlEvent(ConsoleCtrlEvent.CTRL_C, myprocess.id)
But none of them seems to work.
So if someone can help me, I'd be very grateful.
Thank you in advance !
F.C