Dozd

Dozd

  • NA
  • 39
  • 0

when process is stoped remove icon of the program

Oct 7 2010 1:21 PM

Hi I have a program that work good in general but I want to corect one  not very big problem. So in the code there is a method called music() that starts VLC player (default for mp3 format) sevreal times during a day (using a timer). Several minutes after start,  program  is calling method stopVLC() that stops VLC player.This solution is working but after several starts and stops on the taskbar there are also several icons of vlc player (not active icons). If mouse is "touch" one of them all desappears.
So I want to prevent stay of VLC's icons on the task bar. If "vlc" proces is killed I do not like VLC's icons on task bar.
Code is:
private void music()
 {
           
             Process song = Process.Start(@"d:\MySong.mp3");
         
}
 public void stopVLC()
 {
             Process[] proc = Process.GetProcessesByName("vlc");
             foreach (Process vlc in proc)
             {
                 vlc.Kill();
             }
}

Answers (3)