コード例 #1
0
 public SRECForm(string[] args)
 {
     if (args[0] == "-r32Plugin" && Administrator.IsAdministrator())
     {
         Regsvr32Plugin.ScreenCaptureRecorder(); // 注册插件
         InitializeComponent();
     }
     else
     {
         isRestartOrQuit = true;
         Application.Exit();
     }
 }
コード例 #2
0
        private void InstallPluginButton_Click(object sender, EventArgs e)
        {
            if (Administrator.IsAdministrator() == false)
            {
                ProcessStartInfo restartApplication = new ProcessStartInfo(Application.ExecutablePath);
                restartApplication.Arguments = "-r32Plugin";
                restartApplication.Verb      = "runas";

                try { Process.Start(restartApplication); isRestartOrQuit = true; Application.Exit(); } catch { }
            }
            else
            {
                // 注册ScreenCaptureRecorder插件
                Regsvr32Plugin.ScreenCaptureRecorder();
                InstallPluginButton.Enabled = !(Settings.Default.inputDevice == "dshow");
            }
        }
コード例 #3
0
ファイル: SRECForm.cs プロジェクト: cxw3292008/SREC
        private void ScreenCaptureRecorderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (IsAdministrator() == false)
            {
                ProcessStartInfo restartApplication = new ProcessStartInfo(Application.ExecutablePath);
                restartApplication.Arguments = "-r32Plugin";
                restartApplication.Verb      = "runas";

                try
                {
                    Process.Start(restartApplication);

                    isRestartOrQuit = true;
                    Application.Exit();
                }
                catch { }
            }
            else
            {
                Regsvr32Plugin.ScreenCaptureRecorder();
                ScreenCaptureRecorderToolStripMenuItem.Checked = (Settings.Default.inputDevice == "dshow");
            }
        }