Ejemplo n.º 1
0
 public void SeekProcess()
 {
     if (_objectInstance.theProc == null)
     {
         List <System.Diagnostics.Process> processList = System.Diagnostics.Process.GetProcesses().ToList();
         string pName = processList.FirstOrDefault(s => s.ProcessName == SelectedGameProcessName).ProcessName;
         if (pName != null)
         {
             _objectInstance.OpenProcess(pName);
         }
     }
     // var query = System.Diagnostics.Process.GetProcesses().Select( process => new Tuple<string, int>( process.ProcessName, process.Id ) );
 }
Ejemplo n.º 2
0
 public System.Diagnostics.Process LoadProcess(string procName)
 {
     if (_objectInstance.theProc != null)
     {
         return(_objectInstance.theProc);
     }
     try
     {
         if (!ArrivalEvent)
         {
             if (_objectInstance.OpenProcess(procName))
             {
                 LoadedGameProcess    = _objectInstance.theProc;
                 Selected.GameProcess = _objectInstance.theProc;
                 LoadedGameVersion    = _objectInstance.theProc.MainModule.FileVersionInfo.FileVersion;
                 return(Selected.GameProcess);
             }
         }
         ArrivalEvent = true;
     }
     catch (Exception e)
     {
         Console.WriteLine("Something is not right:" + e);
     }
     ArrivalEvent = false;
     return(Selected.GameProcess);
 }
Ejemplo n.º 3
0
        private void openGame()
        {
            if (loaded)
            {
                return;
            }

            //            int gp = m.GetProcIdFromName("test");
            int gameProcId = m.GetProcIdFromName("SupremeRulerUltimate"); //use task manager to find game name. For CoD MW3 it is iw5sp. Do not add .exe extension

            if (gameProcId != 0)
            {
                label2.Invoke(new MethodInvoker(delegate
                {
                    label2.Text = gameProcId.ToString();
                }));
                m.OpenProcess("SupremeRulerUltimate.exe");
                loaded = true;
            }
            else
            {
                label2.Text = "test";
            }
        }