Example #1
0
 private void timer1_Tick(object sender, EventArgs e)
 {
     try
     {
         Process proc = myProcess.getProcess();
         if (proc == null)
         {
             this.Close();
         }
         var placement = GetPlacement(proc.MainWindowHandle);
         var size      = GetControlSize(proc.MainWindowHandle);
         if (placement.showCmd.ToString() == "Normal")
         {
             if (this.Visible == false)
             {
                 this.Visible = true;
             }
             this.Location = new Point(placement.rcNormalPosition.X + size.Width - this.Width, placement.rcNormalPosition.Y + 25);
         }
         else if (placement.showCmd.ToString() == "Minimized")
         {
             if (this.Visible == true)
             {
                 this.Visible = false;
             }
         }
         else if (placement.showCmd.ToString() == "Maximized")
         {
             if (this.Visible == false)
             {
                 this.Visible = true;
             }
             this.Location = new Point(Screen.PrimaryScreen.Bounds.Width - this.Size.Width - 120, 0);
         }
         else
         {
             BibProcess.suprimer(myProcess);
             this.Close();
         }
         if (ApplicationIsActivated(proc, myWindowName))
         {
             if (this.TopMost != true)
             {
                 this.TopMost = true;
             }
         }
         else
         {
             if (this.TopMost == true)
             {
                 this.TopMost = false;
             }
         }
     }
     catch
     {
         BibProcess.suprimer(myProcess);
         this.Close();
     }
 }
Example #2
0
        public MyLabel(string Name_Window, string path)
        {
            InitializeComponent();
            myWindowName  = Name_Window;
            pathMyProcess = path;
            myProcess     = new MyProcess(myWindowName);
            BibProcess.ajouter(myProcess);
            BiBFilesXML bib = new BiBFilesXML();

            if (bib.rechercheFichier(pathMyProcess) != null)
            {
                textBox1.Text = bib.rechercheFichier(pathMyProcess).getComment();
            }
        }
Example #3
0
 private void MyLabel_FormClosed(object sender, FormClosedEventArgs e)
 {
     BibProcess.suprimer(myProcess);
 }
Example #4
0
 private void label2_Click(object sender, EventArgs e)
 {
     BibProcess.suprimer(myProcess);
     this.Close();
 }