c# - 从我的 C# 程序生成的系统托盘中的应用程序中获取工具提示文本
问题描述
我正在创建一个启动命令行实用程序以将文本转换为音频文件的程序(Balabolka 命令行实用程序)。命令行标志之一允许程序将其转换进度显示为任务栏托盘区域中的工具提示。
我想从程序中截取工具提示文本,以便可以在表单的进度条中显示转换进度,但我不确定如何获取该信息。这是我当前使用启动应用程序的代码:
// 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"
}
}
正确的工具提示文本读起来类似,,Balabolka [25%]
如果可以的话,我可以解析出数字。
我之前在搜索时确实遇到过这篇文章: Get ToolTip Text from Icon in System Tray
但我想知道是否可能有一种更简单的方法来实现这一点,因为在这种情况下我是开始这个过程的人并且有一些关于它的信息?
解决方案
推荐阅读
- jquery - 基于jquery过滤项目
- shader - HLSL 整数纹理坐标
- apache-kafka - 使用 Kafka Spout 的 Apache Storm 出现错误:IllegalStateException
- python - 如何在控制台中运行没有复制源的单元格?
- gwt - GWT Bootstrap 预输入事件监听器?
- mysql - 为什么我的 SQL 语句有时没有返回结果?
- javascript - 使用 JavaScript 将 qr 码生成的值放入输入字段的问题
- spring-boot - Spring引导休息调用中的无效mimetype异常
- postgresql - 表的浮动模式定义 - 如何在 pl/sql 中
- javascript - 为什么 Diff-match-patch 破坏 linediff 超过 65K 行