I have a little application that launches a DOS program to connect to a device and retrieve information. Here is, basically, what I am doing:
-Open the DOS application using system.diagnostics.process.start
-set the enableraisingevents property to true
-Send keystrokes using sendkeys.sendwait
-wait for the process to exit
Sometimes, the keystrokes do not seem to be passed to the DOS application and are, instead, lost. It is my guess that this is caused by the process not necessarily having the focus when the keys are sent. So is there a way of ensuring that the process has the focus prior to sending the keys? Or perhaps a different way of sending key strokes that specifies the process they are being sent to?
Thanks, in advance!
-Brian-
I'm not an actor, but I play one on TV.
-Open the DOS application using system.diagnostics.process.start
-set the enableraisingevents property to true
-Send keystrokes using sendkeys.sendwait
-wait for the process to exit
Sometimes, the keystrokes do not seem to be passed to the DOS application and are, instead, lost. It is my guess that this is caused by the process not necessarily having the focus when the keys are sent. So is there a way of ensuring that the process has the focus prior to sending the keys? Or perhaps a different way of sending key strokes that specifies the process they are being sent to?
Thanks, in advance!
-Brian-
I'm not an actor, but I play one on TV.