Exemplo n.º 1
0
        private bool SetStatus(bool status)
        {
            if (status == true)
            {
                try
                {
                    Process[] processes = Process.GetProcessesByName("Diablo III");
                    if (processes.Length > 1)
                    {
                        SelectProcessDialog dialog = new SelectProcessDialog(processes);
                        if (dialog.ShowDialog(this) == DialogResult.OK)
                        {
                            finder = new ItemFinder(dialog.GetID());
                        }
                        else
                        {
                            return(false);
                        }
                    }
                    else
                    {
                        finder = new ItemFinder();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Could not find the diablo process!");
                    return(false);
                }
                timer.Enabled = true;
            }

            if (status == false)
            {
                try
                {
                    finder.Dispose();
                }
                catch (Exception)
                {
                }
                timer.Enabled = false;
            }

            return(true);
        }
Exemplo n.º 2
0
        private bool SetStatus(bool status)
        {
            if (status == true)
            {
                try
                {
                    if (Settings.OverrideProcessID != 0)
                    {
                        finder = new ItemFinder(Settings.OverrideProcessID);
                    }
                    else
                    {
                        finder = new ItemFinder();
                    }
                }
                catch (Exception)
                {
                    MessageBox.Show("Could not find the diablo process!");
                    return(false);
                }
                timer.Enabled = true;
            }

            if (status == false)
            {
                try
                {
                    finder.Dispose();
                }
                catch (Exception)
                {
                }
                timer.Enabled = false;
            }

            return(true);
        }