Beispiel #1
0
        // ******************************************************************************
        public bool ExecScriptFile(string p)
        {
            bool ret = false;

            if (m_TargetVersionIndex < 0)
            {
                return(ret);
            }

            string tag = m_InstalledAFX[m_TargetVersionIndex];

            ProcessAE pae = new ProcessAE();

            if (CheckRun(tag, out pae) != AEStutas.IsRunning)
            {
                return(ret);
            }

            if (File.Exists(p) == false)
            {
                return(ret);
            }

            string exePath = CombineAE(tag);

            if (File.Exists(exePath) == true)
            {
                var app = new ProcessStartInfo();
                app.FileName        = exePath;
                app.Arguments       = "-r " + p;
                app.UseShellExecute = true;
                if (pae.IsWS_MAXIMIZE)
                {
                    app.WindowStyle = ProcessWindowStyle.Maximized;
                }
                Process ps = Process.Start(app);
                if (pae.Proc != null)
                {
                    if (pae.IsWS_MAXIMIZE == true)
                    {
                        FileInfo fi = new FileInfo(m_AeWin);

                        if (fi.Exists == true)
                        {
                            ProcessStartInfo aeWin = new ProcessStartInfo();
                            aeWin.FileName        = fi.FullName;
                            aeWin.Arguments       = String.Format("/max /i{0}", pae.ProcessID);
                            aeWin.UseShellExecute = true;
                            aeWin.WindowStyle     = ProcessWindowStyle.Hidden;
                            Process ps2 = Process.Start(aeWin);
                        }
                    }
                }
                ret = true;
            }
            return(ret);
        }
Beispiel #2
0
        // *********************************************************************************
        static public ProcessAE[] ProcessAEList()
        {
            List <ProcessAE> ret = new List <ProcessAE>();

            foreach (Process p in Process.GetProcesses())
            {
                if (p.ProcessName == "AfterFX")
                {
                    ProcessAE pae = new ProcessAE(p);
                    ret.Add(pae);
                }
            }
            return(ret.ToArray());
        }
Beispiel #3
0
        // ******************************************************************************
        static public AEStutas CheckRun(string s, out ProcessAE pae)
        {
            AEStutas ret = AEStutas.None;

            ProcessAE[] lst = ProcessAEList();
            pae = new ProcessAE();
            if (lst.Length > 0)
            {
                foreach (ProcessAE p in lst)
                {
                    if (p.VersionStr == s)
                    {
                        ret = AEStutas.IsRunning;
                        pae = p;
                        break;
                    }
                }
            }
            return(ret);
        }