示例#1
0
        private void playButtonPanel_MouseUp(object sender, MouseEventArgs e)
        {
            if (usernameTextBox1.Text == "username" || usernameTextBox1.Text == "" || passwordTextBox1.Text == "password" || passwordTextBox1.Text == "")
            {
                MessageBox.Show(this, "Please fill out both username and password fields.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            new Task(() => {
                if (ProcessInformation.IsOpen("Project Altis Launcher"))
                {
                    HandleIDs.SendMessage(
                        HandleIDs.GetChildWindows(ProcessInformation.WindowHandle("Project Altis Launcher"))[(int)ControlLocation.UsernameText],
                        (int)WindowMessages.WM_SETTEXT, 0, usernameTextBox1.Text
                        );

                    HandleIDs.SendMessage(
                        HandleIDs.GetChildWindows(ProcessInformation.WindowHandle("Project Altis Launcher"))[(int)ControlLocation.PasswordText],
                        (int)WindowMessages.WM_SETTEXT, 0, passwordTextBox1.Text
                        );

                    HandleIDs.SendMessage(
                        HandleIDs.GetChildWindows(ProcessInformation.WindowHandle("Project Altis Launcher"))[(int)ControlLocation.PlayButton],
                        (int)WindowMessages.BM_CLICK, 0, null
                        );
                }
            }).Start();

            loadingLabel.Visible    = true;
            loadingProgress.Visible = true;
            loadingProgress.MarqueeAnimationSpeed = 30;
        }
示例#2
0
 private void sanityChecks_Tick(object sender, EventArgs e)
 {
     if (ProcessInformation.IsOpen("Altis"))
     {
         this.Close();
     }
 }
示例#3
0
 private void button1_Click(object sender, EventArgs e)
 {
     //exit button gotta fix event name
     if (ProcessInformation.IsOpen(ProcessName))
     {
         Process pName = Process.GetProcessesByName(ProcessName)[0];
         pName.Kill();
     }
     this.Close();
 }