0

Need to open Windows forms application in minimized mode from another application using code in C#

I am using below code for opening windows forms application in minimized mode.

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();

But i am unable to show balloon notification on application start.I have written notify ballon code in form constructor.My code is not firing as am opening application in minimized mode and that time form is not opened in Maximized mode or taskbar.It will shown only in NotifyTray icon. So in that case user may not identify the ervice which i started in the background so i just wanted to show a ballon notification about the service with out opening application in Normal or maximized mode.

notifyIcon1.BalloonTipIcon = ToolTipIcon.Info;
notifyIcon1.BalloonTipText = "Service Started";
notifyIcon1.ShowBalloonTip(3000);

Please let us know if there is any place or event with which i can show ballon notification on application start.

Mahesh
  • 823
  • 1
  • 11
  • 29
  • Is this the [same case](https://stackoverflow.com/a/48892114/3110834)? – Reza Aghaei Jun 06 '18 at 07:58
  • 1
    Your title is very misleading as you seem to already have that part working, perhaps focus on the part you actually have a problem with, the balloon notification – musefan Jun 06 '18 at 07:59
  • My code snippet for notification is working. My problem here i need to show a balloon notification on application start which i wrote in Form1 constructor. But that is not firing as the form is not active in the UI (because it is opened in minimized mode) – Mahesh Jun 06 '18 at 09:02

0 Answers0