public static void Initialize() { _Flipper = new Flipper(TimeSpan.FromMilliseconds(300), delegate { }); InterceptKeys.Hook(); InterceptKeys.KeyPressed += InterceptKeys_KeyPressed; }
public static void Main() { watch = new Stopwatch(); InterceptKeys.Hook(); //Вешаем хук. InterceptKeys.KeyDown += InterceptKeys_KeyDown; //событие "Клавиша нажата". InterceptKeys.KeyUp += InterceptKeys_KeyUp; //событие "Клавиша отпущена". //InterceptKeys.KeyEvent += InterceptKeys_KeyEvent; //тоже можно юзать, но имхо такое //List<Keys> PressedKeys = InterceptKeys.KeysDown; //Получаем список зажатых в настоящий момент клавиш. //InterceptKeys.KeyState IsCtrlPressed = //InterceptKeys.GetState(Keys.ControlKey); //Получаем состояние клавиши CTRL Application.Run(); InterceptKeys.UnHook(); //Снимаем хук. }
static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); int intTrouve = 0; //Obtient le processus en cours de l'application Process Proc_EnCours = Process.GetCurrentProcess(); //Collection des processus actuellement lancés Process[] Les_Proc = Process.GetProcesses(); //Pour chaque processus lancé for (int i = 0; i < Les_Proc.Length; i++) { if (Les_Proc[i].ProcessName.Equals("KeyLog")) { intTrouve = intTrouve + 1; } } if (intTrouve > 1) { MessageBox.Show("Le programme est déja en cours d'utilisation !"); } else { //==================================== // MAKING THIS APP RUNNING ON STARTUP //==================================== /* * Microsoft.Win32.RegistryKey rkApp = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); * * string[] Run_Keys = rkApp.GetSubKeyNames(); * int l = rkApp.SubKeyCount; * string appPath = Application.ExecutablePath.ToString(); * * if (rkApp.GetValue("KeyLog") == null) * { * rkApp.SetValue("KeyLog", appPath); * } * else * { * //rkApp.DeleteValue("KeyLog", false); * } */ InterceptKeys.Hook(); Application.Run(); } }
/// <summary> /// The main entry point for the application. /// </summary> static void Main(string[] args) { // Start main application GUI Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); AppSelectionGUI gui = new AppSelectionGUI(); Application.Run(gui); // Start XNA using (Game1 game = new Game1(gui.selectedApp)) { InterceptKeys.Hook(); game.Run(); InterceptKeys.Unhook(); } }
/// <summary> /// Load and Initialize Game Components /// </summary> public override void LoadContent() { //Adjust DWM frame settings int[] margins = new int[] { 0, 0, ScreenManager.maxWidth, ScreenManager.maxHeight }; User32.DwmExtendFrameIntoClientArea(ScreenManager.Game.Window.Handle, ref margins); DepthStencilState depthState = new DepthStencilState(); depthState.DepthBufferEnable = false; depthState.DepthBufferWriteEnable = false; ScreenManager.GraphicsDevice.DepthStencilState = depthState; //Hook the interceptKeys module InterceptKeys.Hook(); bciControl = new WowControl(ScreenManager.Game); ScreenManager.Game.Components.Add(bciControl); ssvepDX = new SSVEP_DirectX_Advanced_V2(ScreenManager.Game); ssvepDX.Initialize(ScreenManager.form, ScreenManager.SpriteBatch); ScreenManager.Game.Components.Add(ssvepDX); }