Beispiel #1
0
        private void goGenerateProcessesFriendship()
        {

            spaceForProcesses.Left = 150;
            spaceForProcesses.Width = spaceForProcesses.Width - 150;

            spaceForProcesses.Top = bottomPanel.Top;
            

            spaceForProcesses.Height = bottomPanel.Height;

            spaceForProcesses.Invalidate();
            
            foreach (var theProcess in Process.GetProcesses())
            {
                
            
                Label hmGreatJobFantasticAmazing = new Label();
                // hmGreatJobFantasticAmazing.BackgroundImageLayout = ImageLayout.Center;

                if (theProcess.MainWindowTitle != "")
                {
                    //hmGreatJobFantasticAmazing.Text = theProcess.MainWindowTitle;
                    hmGreatJobFantasticAmazing.Margin = new Padding(6,0,6,0);
                    
                    hmGreatJobFantasticAmazing.Visible = true;
                    
                    // hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 13, FontStyle.Italic);
                    

                    Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap().Save(@"C:\ProjectSnowshoes\temptaskico.png");

                    DualImageForm thanksVKLines = new DualImageForm();
                    thanksVKLines.pic = Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap();
                    thanksVKLines.analyze();
                    thanksVKLines.pic2.Save(@"C:\ProjectSnowshoes\newtemptaskico.png");

                    ImageFactory grayify = new ImageFactory();
                    grayify.Load(@"C:\ProjectSnowshoes\temptaskico.png");
                    //grayify.Tint(Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]));
                    //grayify.Tint(Color.FromName("Gray"));
                    hmGreatJobFantasticAmazing.Image = grayify.Image;

                    Label areYouSeriouslyStillDoingThisLetItGo = new Label();

                    hmGreatJobFantasticAmazing.Click += (sender, args) =>
                    {
                            System.Diagnostics.Process.Start(theProcess.Modules[0].FileName);   
                    };
                    hmGreatJobFantasticAmazing.MouseHover += (sender, args) =>
                        {
                            int recordNao = hmGreatJobFantasticAmazing.Left;
                            //hmGreatJobFantasticAmazing.BackgroundImageLayout = ImageLayout.Zoom;
                            //hmGreatJobFantasticAmazing.Height = 75;
                            /*hmGreatJobFantasticAmazing.ImageAlign = ContentAlignment.MiddleLeft;
                            hmGreatJobFantasticAmazing.AutoEllipsis = true;
                            hmGreatJobFantasticAmazing.Width = 250;
                            hmGreatJobFantasticAmazing.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);
                            hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                            hmGreatJobFantasticAmazing.ForeColor = Color.White;
                            
                            hmGreatJobFantasticAmazing.TextAlign = ContentAlignment.MiddleLeft;
                            hmGreatJobFantasticAmazing.Text = "        " + theProcess.MainWindowTitle;*/

                            hmGreatJobFantasticAmazing.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);

                            
                            areYouSeriouslyStillDoingThisLetItGo.Left = recordNao + 150;
                            areYouSeriouslyStillDoingThisLetItGo.Text = theProcess.MainWindowTitle;
                            areYouSeriouslyStillDoingThisLetItGo.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);
                            areYouSeriouslyStillDoingThisLetItGo.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                            areYouSeriouslyStillDoingThisLetItGo.ForeColor = Color.White;
                            areYouSeriouslyStillDoingThisLetItGo.TextAlign = ContentAlignment.MiddleLeft;

                            panel1.Controls.Add(areYouSeriouslyStillDoingThisLetItGo);

                            //Measuring string turnt-up-edness was guided by an answer on Stack Overflow by Tom Anderson.
                            Graphics heyGuessWhatGraphicsYeahThatsRight = Graphics.FromImage(new Bitmap(1,1));
                            SizeF sure = heyGuessWhatGraphicsYeahThatsRight.MeasureString(theProcess.MainWindowTitle, new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular, GraphicsUnit.Point));
                            Size sureAgain = sure.ToSize();

                            if (sureAgain.Width >= 300)
                            {
                                areYouSeriouslyStillDoingThisLetItGo.Width = sureAgain.Width + 10;
                            }
                            else
                            {
                                areYouSeriouslyStillDoingThisLetItGo.Width = 300;
                            }

                            areYouSeriouslyStillDoingThisLetItGo.Height = bottomPanel.Height;
                            areYouSeriouslyStillDoingThisLetItGo.Top = Screen.PrimaryScreen.WorkingArea.Height - bottomPanel.Height;
                            


                            areYouSeriouslyStillDoingThisLetItGo.Show();
                            areYouSeriouslyStillDoingThisLetItGo.Visible = true;
                            areYouSeriouslyStillDoingThisLetItGo.BringToFront();
                            areYouSeriouslyStillDoingThisLetItGo.Invalidate();

                            //hmGreatJobFantasticAmazing.BringToFront();
                            //panel1.Controls.Add(hmGreatJobFantasticAmazing);
                            //hmGreatJobFantasticAmazing.Top = bottomPanel.Top - 40;
                            //hmGreatJobFantasticAmazing.Left = recordNao + 150;
                            //hmGreatJobFantasticAmazing.BringToFront();
                            //hmGreatJobFantasticAmazing.Invalidate();

                            
                            /*hmGreatJobFantasticAmazing.Height = 100;
                            hmGreatJobFantasticAmazing.Width = 100;*/
                        };
                    hmGreatJobFantasticAmazing.MouseLeave += (sender, args) =>
                        {
                            /*hmGreatJobFantasticAmazing.ImageAlign = ContentAlignment.MiddleCenter;
                            hmGreatJobFantasticAmazing.AutoEllipsis = false;
                            hmGreatJobFantasticAmazing.Width = 40;
                            hmGreatJobFantasticAmazing.BackColor = Color.Transparent;
                            //hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                            //hmGreatJobFantasticAmazing.ForeColor = Color.White;

                            hmGreatJobFantasticAmazing.TextAlign = ContentAlignment.MiddleLeft;
                            hmGreatJobFantasticAmazing.Text = "";*/

                            panel1.Controls.Remove(areYouSeriouslyStillDoingThisLetItGo);
                            hmGreatJobFantasticAmazing.BackColor = Color.Transparent;


                        };
                    
                    

                    openFileToolTip.SetToolTip(hmGreatJobFantasticAmazing, theProcess.MainWindowTitle);
                    //hmGreatJobFantasticAmazing.BackgroundImage = Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap();
                    
                    
                    
                    hmGreatJobFantasticAmazing.Height = bottomPanel.Height;
                    hmGreatJobFantasticAmazing.Width = 40;
                    
                    spaceForProcesses.Controls.Add(hmGreatJobFantasticAmazing);
                }

            }
        }
Beispiel #2
0
        private void goGenerateProcessesFriendship()
        {
            spaceForProcesses.Left  = 150;
            spaceForProcesses.Width = spaceForProcesses.Width - 150;

            spaceForProcesses.Top = bottomPanel.Top;


            spaceForProcesses.Height = bottomPanel.Height;

            spaceForProcesses.Invalidate();

            foreach (var theProcess in Process.GetProcesses())
            {
                Label hmGreatJobFantasticAmazing = new Label();
                // hmGreatJobFantasticAmazing.BackgroundImageLayout = ImageLayout.Center;

                if (theProcess.MainWindowTitle != "")
                {
                    //hmGreatJobFantasticAmazing.Text = theProcess.MainWindowTitle;
                    hmGreatJobFantasticAmazing.Margin = new Padding(6, 0, 6, 0);

                    hmGreatJobFantasticAmazing.Visible = true;

                    // hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 13, FontStyle.Italic);


                    Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap().Save(@"C:\ProjectSnowshoes\temptaskico.png");

                    DualImageForm thanksVKLines = new DualImageForm();
                    thanksVKLines.pic = Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap();
                    thanksVKLines.analyze();
                    thanksVKLines.pic2.Save(@"C:\ProjectSnowshoes\newtemptaskico.png");

                    ImageFactory grayify = new ImageFactory();
                    grayify.Load(@"C:\ProjectSnowshoes\temptaskico.png");
                    //grayify.Tint(Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]));
                    //grayify.Tint(Color.FromName("Gray"));
                    hmGreatJobFantasticAmazing.Image = grayify.Image;

                    Label areYouSeriouslyStillDoingThisLetItGo = new Label();

                    hmGreatJobFantasticAmazing.Click += (sender, args) =>
                    {
                        System.Diagnostics.Process.Start(theProcess.Modules[0].FileName);
                    };
                    hmGreatJobFantasticAmazing.MouseHover += (sender, args) =>
                    {
                        int recordNao = hmGreatJobFantasticAmazing.Left;
                        //hmGreatJobFantasticAmazing.BackgroundImageLayout = ImageLayout.Zoom;
                        //hmGreatJobFantasticAmazing.Height = 75;

                        /*hmGreatJobFantasticAmazing.ImageAlign = ContentAlignment.MiddleLeft;
                         * hmGreatJobFantasticAmazing.AutoEllipsis = true;
                         * hmGreatJobFantasticAmazing.Width = 250;
                         * hmGreatJobFantasticAmazing.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);
                         * hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                         * hmGreatJobFantasticAmazing.ForeColor = Color.White;
                         *
                         * hmGreatJobFantasticAmazing.TextAlign = ContentAlignment.MiddleLeft;
                         * hmGreatJobFantasticAmazing.Text = "        " + theProcess.MainWindowTitle;*/

                        hmGreatJobFantasticAmazing.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);


                        areYouSeriouslyStillDoingThisLetItGo.Left      = recordNao + 150;
                        areYouSeriouslyStillDoingThisLetItGo.Text      = theProcess.MainWindowTitle;
                        areYouSeriouslyStillDoingThisLetItGo.BackColor = Color.FromName(Properties.Settings.Default.custColor[Properties.Settings.Default.whoIsThisCrazyDoge]);
                        areYouSeriouslyStillDoingThisLetItGo.Font      = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                        areYouSeriouslyStillDoingThisLetItGo.ForeColor = Color.White;
                        areYouSeriouslyStillDoingThisLetItGo.TextAlign = ContentAlignment.MiddleLeft;

                        panel1.Controls.Add(areYouSeriouslyStillDoingThisLetItGo);

                        //Measuring string turnt-up-edness was guided by an answer on Stack Overflow by Tom Anderson.
                        Graphics heyGuessWhatGraphicsYeahThatsRight = Graphics.FromImage(new Bitmap(1, 1));
                        SizeF    sure      = heyGuessWhatGraphicsYeahThatsRight.MeasureString(theProcess.MainWindowTitle, new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular, GraphicsUnit.Point));
                        Size     sureAgain = sure.ToSize();

                        if (sureAgain.Width >= 300)
                        {
                            areYouSeriouslyStillDoingThisLetItGo.Width = sureAgain.Width + 10;
                        }
                        else
                        {
                            areYouSeriouslyStillDoingThisLetItGo.Width = 300;
                        }

                        areYouSeriouslyStillDoingThisLetItGo.Height = bottomPanel.Height;
                        areYouSeriouslyStillDoingThisLetItGo.Top    = Screen.PrimaryScreen.WorkingArea.Height - bottomPanel.Height;



                        areYouSeriouslyStillDoingThisLetItGo.Show();
                        areYouSeriouslyStillDoingThisLetItGo.Visible = true;
                        areYouSeriouslyStillDoingThisLetItGo.BringToFront();
                        areYouSeriouslyStillDoingThisLetItGo.Invalidate();

                        //hmGreatJobFantasticAmazing.BringToFront();
                        //panel1.Controls.Add(hmGreatJobFantasticAmazing);
                        //hmGreatJobFantasticAmazing.Top = bottomPanel.Top - 40;
                        //hmGreatJobFantasticAmazing.Left = recordNao + 150;
                        //hmGreatJobFantasticAmazing.BringToFront();
                        //hmGreatJobFantasticAmazing.Invalidate();


                        /*hmGreatJobFantasticAmazing.Height = 100;
                         * hmGreatJobFantasticAmazing.Width = 100;*/
                    };
                    hmGreatJobFantasticAmazing.MouseLeave += (sender, args) =>
                    {
                        /*hmGreatJobFantasticAmazing.ImageAlign = ContentAlignment.MiddleCenter;
                         * hmGreatJobFantasticAmazing.AutoEllipsis = false;
                         * hmGreatJobFantasticAmazing.Width = 40;
                         * hmGreatJobFantasticAmazing.BackColor = Color.Transparent;
                         * //hmGreatJobFantasticAmazing.Font = new System.Drawing.Font(Properties.Settings.Default.fontsOfScience[Properties.Settings.Default.whoIsThisCrazyDoge], 14, FontStyle.Regular);
                         * //hmGreatJobFantasticAmazing.ForeColor = Color.White;
                         *
                         * hmGreatJobFantasticAmazing.TextAlign = ContentAlignment.MiddleLeft;
                         * hmGreatJobFantasticAmazing.Text = "";*/

                        panel1.Controls.Remove(areYouSeriouslyStillDoingThisLetItGo);
                        hmGreatJobFantasticAmazing.BackColor = Color.Transparent;
                    };



                    openFileToolTip.SetToolTip(hmGreatJobFantasticAmazing, theProcess.MainWindowTitle);
                    //hmGreatJobFantasticAmazing.BackgroundImage = Icon.ExtractAssociatedIcon(theProcess.Modules[0].FileName).ToBitmap();



                    hmGreatJobFantasticAmazing.Height = bottomPanel.Height;
                    hmGreatJobFantasticAmazing.Width  = 40;

                    spaceForProcesses.Controls.Add(hmGreatJobFantasticAmazing);
                }
            }
        }