Esempio n. 1
0
 private void btnrun_Click(object sender, EventArgs e)
 {
     try
     {
         Shell32.Shell shell = new Shell32.Shell();
         shell.FileRun();
     }
     catch (Exception r)
     {
         MessageBox.Show("Try Again", "Error", MessageBoxButtons.OK);
     }
 }
Esempio n. 2
0
 private void Button_Click_2(object sender, RoutedEventArgs e)
 {
     Shell32.Shell shell = new Shell32.Shell();
     shell.FileRun();
 }
Esempio n. 3
0
        public KeyHook(Form form)
        {
            this.form = form;
            keyDown.Add(Keys.LWin, delegate
            {
                win_pushed = true;
                return(false);
            });
            keyUp.Add(Keys.LWin,
                      delegate
            {
                win_pushed = false;
                return(false);
            }
                      );
            keyUp.Add(Keys.Left, delegate
            {
                if (form.Visible)
                {
                    LeftArrowEvent?.Invoke();
                    return(false);
                }
                return(true);
            });
            keyUp.Add(Keys.Right, delegate
            {
                if (form.Visible)
                {
                    RightArrowEvent?.Invoke();
                    return(false);
                }
                return(true);
            });
            keyUp.Add(Keys.Enter, delegate
            {
                if (form.Visible)
                {
                    EnterClickEvent?.Invoke();
                    return(false);
                }
                return(true);
            });
            keyUp.Add(Keys.Escape, delegate
            {
                if (form.Visible)
                {
                    OpenCloseEvent?.Invoke();
                    return(false);
                }
                return(true);
            });
            startApps.Add(Keys.D, delegate
            {
                OpenCloseEvent?.Invoke();
            });
            startApps.Add(Keys.E, delegate
            {
                Process.Start("explorer");
            });
            startApps.Add(Keys.I, delegate
            {
                Process.Start("ms-settings:");
            });
            startApps.Add(Keys.L, delegate
            {
                Process.Start("rundll32.exe user32.dll,LockWorkStation");
            });
            startApps.Add(Keys.R, delegate {
                Shell32.Shell shell = new Shell32.Shell();
                shell.FileRun();
            });
            startApps.Add(Keys.D0, delegate {
                ShutdownClickEvent?.Invoke();
            });

            hookDelegate = HookCallback;
            using (Process curProcess = Process.GetCurrentProcess())
            {
                using (ProcessModule curModule = curProcess.MainModule)
                {
                    _hookID = SetWindowsHookEx(WH_KEYBOARD_LL, hookDelegate,
                                               GetModuleHandle(curModule.ModuleName), 0);
                }
            }
        }
Esempio n. 4
0
 private void button2_Click(object sender, EventArgs e)
 {
     Shell32.Shell shell = new Shell32.Shell();
     shell.FileRun();
     DialogResult help = MessageBox.Show("Type 'bash' in the 'run' dialog box to proceed");
 }
Esempio n. 5
0
 private void RunDialogAction()
 {
     // Microsoft Shell Controls and Automation
     Shell32.Shell shell = new Shell32.Shell();
     shell.FileRun();
 }
        private void OnRunNewTaskCommand()
        {
            var shell = new Shell32.Shell();

            shell.FileRun();
        }