简体   繁体   中英

Winform did not show the icon in the taskbar

I have two programs A and B, when something happened I use the process.start() in A to launch B. after the B was successfully launched the icon of B did not show in the windows taskbar. But when I click on the window of B, the icon of B will show in the windows taskbar. I Can't figure out the reason.

Here is my code snippet

    private void StartProcess()
    {
        string appName = Application.StartupPath + @"\AppB.exe";

        ProcessStartInfo psi = new ProcessStartInfo()
        {
            FileName = appName,
        };

        Process process = Process.Start(psi);

    }

if B is your coded program then set application icon in Installer. After installation that icon will be displayed in task bar on every launch.

try this

ShowInTaskBar = true;

and you have to use NotifyIcon

http://msdn.microsoft.com/en-us/library/system.windows.forms.notifyicon(v=vs.110).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM