c# - 需要使用 C# 中的代码从另一个应用程序以最小化模式打开 Windows 窗体应用程序
问题描述
需要使用 C# 中的代码从另一个应用程序以最小化模式打开 Windows 窗体应用程序
我正在使用以下代码以最小化模式打开 Windows 窗体应用程序。
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.Arguments = null;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.WindowStyle = ProcessWindowStyle.Minimized;
process.StartInfo.FileName = fileName;
process.StartInfo.UseShellExecute = true;
process.Start();
但是我无法在应用程序启动时显示气球通知。我已经在表单构造函数中编写了通知气球代码。我的代码没有触发,因为我在最小化模式下打开应用程序并且时间表单没有在最大化模式或任务栏下打开。它将显示仅在 NotifyTray 图标中。因此,在这种情况下,用户可能无法识别我在后台启动的服务,所以我只想显示有关该服务的气球通知,而无需在正常或最大化模式下打开应用程序。
notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.BalloonTipText = "Service Started";
notifyIcon1.ShowBalloonTip(3000);
请让我们知道是否有任何地方或事件可以在申请开始时显示气球通知。
解决方案
推荐阅读
- javascript - 如何延迟 SurveyMonkey 弹出窗口?
- sql - AWS Athena SQL 对不同行中的最小值进行分组和查找
- javascript - 如何使用预定义的字符串读取嵌套对象的值
- c# - 仅在 Datagrid WPF C# 中显示项目的子集
- uwp - UWP CreateFile2 ERROR_NOT_SUPPORTED_IN_APPCONTAINER 打开设备
- python - python中的JSON到JSONL
- c# - 将 Serilog 连接到 MSSQL 数据库的细节和基础是什么?
- python - 如何在 Python3 中使用生成器对象( pathlib.iterdir )进行比较?
- python - 使用带参数的映射器函数重命名数据框列
- c - Mac 上 C 的代码块_运行问题