I am creating a program that launches a command line utility to convert text to audio files (Balabolka commandline utility). One of the command line flags allows the program to display its conversion progress as a tooltip in the taskbar tray area.
I would like to intercept the tooltip text from the program so that I can display the progress of the conversion in a progress bar on my form, but I'm not sure how to grab that information. Here is the code that I am currently using the launch the application:
// Command line arguments for Balabolka
string arguments = "-f \"book.html\" -w \"book.wav\" -n \"Amy\" -tray";
// Set the working directory to the folder containing the Balabolka utility
Directory.SetCurrentDirectory("C:\\Balabolka");
// Launch the command line utility and serve other UI messages while waiting for it to close
using (Process balcon = Process.Start("balcon.exe", arguments))
{
while (!balcon.HasExited)
{
Application.DoEvents();
caption = balcon.MainWindowTitle; //<-- This doesn't get the info I want. It only returns "balabolka"
}
}
The proper tooltip text reads something like, Balabolka [25%]
, and I can parse out the number if I can get at it.
I did come across this post earlier while searching: Get ToolTip Text from Icon in System Tray
But I'm wondering if there may be a simpler way to accomplish this since I'm the one starting the process in this case and have some information on it?