private void addPanelItem(ref AppHolder app) { apps.Add(app.ProcessHandle, app); Panel_Item pan = new Panel_Item(ref app); panTaskBar.Controls.Add(pan); panItems.Add(app.ProcessHandle, pan); pan.AppVisChange += AppVis; panelPlace(); }
private void FileLaunch() { using (NamedPipeClientStream pipeClient = new NamedPipeClientStream("ProjectI2padamsNet")) { if (!pipeClient.IsConnected) { pipeClient.Connect(); } string temp = ""; using (StreamReader sr = new StreamReader(pipeClient)) { while (true)//temp != "ProChicSuspend" || temp!= "ProChicExit") { while ((temp = sr.ReadLine()) == "") { ; } Debug.WriteLineIf(temp != "", temp); if (temp == "ProChicExit") { DialogResult = DialogResult.Cancel; Debug.WriteLine("CANCEL"); this.Close(); thrdFileListener.Abort(); } else if (temp == "ProChicSuspend") { DialogResult = DialogResult.OK; Debug.WriteLine("OK"); this.Close(); thrdFileListener.Abort(); } else { this.Invoke((MethodInvoker) delegate { AppHolder app = new AppHolder(ProperAppLaunch(temp), ""); if (app != null) { elvDesktop.Controls.Add(app); } app.AppClose += clospro; addPanelItem(ref app); }); } } } } }
public Panel_Item(ref AppHolder app) { PictureBox pic = new PictureBox(); Text = app.Text; BackgroundImageLayout = ImageLayout.Stretch; Size = new Size(com.Config.GetConfigAsInt32("Taskbar", "ItemWidth"), com.Config.GetConfigAsInt32("Taskbar", "ItemHeight")); appPtr = app.ProcessHandle; Visible = true; pic.Location = new Point(6, (Height / 2) - 8); pic.Size = new Size(16, 16); if (app.programIcon.Image != null) { pic.Image = new Bitmap(app.programIcon.Image, 16, 16); } pic.SizeMode = PictureBoxSizeMode.Normal; //pic.BringToFront(); Controls.Add(pic); this.Click += SingleClick; }