예제 #1
0
파일: Form1.cs 프로젝트: Arnesz/osu-hack
        private void Form1_Load(object sender, EventArgs e)
        {
            path  = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData);
            path += (@"\osu!");

            if (Directory.Exists(path))
            {
                System.Windows.Forms.MessageBox.Show("Auto detected osu! directory:" + Environment.NewLine + path, "Info");
                textBox1.Text = path;
            }
            else
            {
                path  = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                path += (@"\osu!");

                if (Directory.Exists(path))
                {
                    System.Windows.Forms.MessageBox.Show("Auto detected osu! directory:" + Environment.NewLine + path, "Info");
                    textBox1.Text = path;
                }
                else
                {
                    path  = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
                    path += (@"\osu!");

                    if (Directory.Exists(path))
                    {
                        System.Windows.Forms.MessageBox.Show("Auto detected osu! directory:" + Environment.NewLine + path, "Info");
                        textBox1.Text = path;
                    }
                    else
                    {
                        path  = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles);
                        path += (@"\osu!");

                        if (Directory.Exists(path))
                        {
                            System.Windows.Forms.MessageBox.Show("Auto detected osu! directory:" + Environment.NewLine + path, "Info");
                            textBox1.Text = path;
                        }
                        else
                        {
                            System.Windows.Forms.MessageBox.Show("Auto detecting osu! folder failed." + Environment.NewLine + "Pick osu! path manually", "Info");
                        }
                    }
                }
            }

            int procID = m.GetProcIdFromName("osu!");

            if (procID > 0)
            {
                System.Windows.Forms.MessageBox.Show("osu! is running, plese close osu!.", "Info");
            }
            else
            {
            }
        }
예제 #2
0
        } // Tries to execute the batch file

        private void StatusCheck()
        {
            int procID = m.GetProcIdFromName("cmd");

            if (procID > 0)
            {
                label6.Text = "Status: Running";
            }
            else
            {
                label6.Text = "Status: Not running";
            }

            int procID2 = m.GetProcIdFromName("osu!");

            if (procID2 > 0)
            {
                label7.Text = "osu!: Running";
            }
            else
            {
                label7.Text = "osu!: Not running";
            }
        } //Check Running Status