示例#1
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            MainGUI f = new MainGUI();

            // Initialize Global Shortcut Hooks
            //ShortcutCapture SC = ShortCuts(f);

            Application.Run();
            //SC.StopCapturing();
        }
示例#2
0
        static ShortcutCapture ShortCuts(Form f)
        {
            /************************/
            MainGUI form = (MainGUI)f; // Replace "MainGUI" with the name of your startup form
            /************************/

            ShortcutCapture SC = new ShortcutCapture();

            SC.AddShortCut(new Keys[] { Keys.LControlKey, Keys.F10 }, ShortcutCapture.testfunc, new object[] { form });
            SC.AddShortCut(new Keys[] { Keys.LControlKey, Keys.F11 }, ShortcutCapture.test2func, new object[] { form });
            SC.Capture();

            return(SC);
        }
示例#3
0
        public static void testfunc(object args)
        {
            CallbackParameter Argument = (CallbackParameter)args;
            MainGUI           f        = (MainGUI)Argument.args[0];

            try
            {
                var d = "Console write text";
                f.Invoke(f.Con_Write, d);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message + "\n\n" + ex.StackTrace);
            }
        }
示例#4
0
 public static void test2func(object args)
 {
     CallbackParameter Argument = (CallbackParameter)args;
     MainGUI           f        = (MainGUI)Argument.args[0];
 }