Currently running this code to open Business Vision (an application written by someone else that i don't have access to the code of):
ProcessStartInfo myProcessStartInfo = new ProcessStartInfo(BusinessVisionPath);
myProcessStartInfo.UseShellExecute = false;
myProcessStartInfo.RedirectStandardOutput = true;
myProcess.StartInfo = myProcessStartInfo;
myProcess.Start();
StreamReader myStreamReader = myProcess.StandardOutput;
Boolean done = false;
while (done == false)
{
int s = myStreamReader.Read();
Console.WriteLine(s);
if (s == -1)
{
done = true;
Process IProcess = new Process();
ProcessStartInfo IProcessStartInfo = new ProcessStartInfo(QuickPrinterPath);
IProcessStartInfo.WindowStyle = ProcessWindowStyle.Maximized;
IProcess.StartInfo = IProcessStartInfo;
IProcess.Start();
}
}
myProcess.Close();
Console.ReadLine();
Anyways,
this code currently opens my printer program when BusinessVision closes.
Questions:
- How (if possible) can i open my program when a certain message box pops up within BV ("Are you sure you want to print an invoice"?)
- Is it possible to get any data from the application ? like raw data that i can parse through as it runs or something?