static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); MainGUI f = new MainGUI(); // Initialize Global Shortcut Hooks //ShortcutCapture SC = ShortCuts(f); Application.Run(); //SC.StopCapturing(); }
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); }
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); } }
public static void test2func(object args) { CallbackParameter Argument = (CallbackParameter)args; MainGUI f = (MainGUI)Argument.args[0]; }