public Desktop() { windowToBody = new Dictionary<Window, Body>(); contactJoints = new Dictionary<int, FixedHingeJoint>(); engine = new PhysicsEngine(); engine.BroadPhase = new SweepAndPruneDetector(); engine.Solver = new SequentialImpulsesSolver(); timer = new PhysicsTimer(PhysicsTimerCallback, 0.01); timer.IsRunning = true; injectorClass = new DWMInjectorClass(); if (!injectorClass.IsInjected) injectorClass.Inject(); injectorClass.GetDWMExObject(out dwm); Debug.Assert(dwm != null, "DWM is NULL"); windowManager = new WindowManager(); windowManager.WindowCreated += windowManager_WindowCreated; windowManager.WindowDestroyed += windowManager_WindowDestroyed; windowManager.Register(MessageEvents.Handle); ThreadPool.QueueUserWorkItem(delegate { hook = new LowLevelMouseHook(MouseHook); hook.StartHook(); Application.Run(); }); }
void InputWorker() { RawDevice.RegisterRawDevices(0x01, 0x02, InputMode.BackgroundMode); RawDevice.RegisterRawDevices(HID_USAGE_PAGE_DIGITIZER, HID_USAGE_DIGITIZER_PEN, InputMode.BackgroundMode); RawDevice.RawInput += RawDevice_RawInput; hook = new LowLevelMouseHook(OnMouseAction); Application.Run(); }
public TrayApp() { InitializeComponent(); // Init the options manager w/ default options GetOptions(); // Set up the hooks _keyboard = new LowLevelKeyboardHook(); _keyboard.MessageIntercepted += Hook.KeyboardHook; _keyboard.StartHook(); _mouse = new LowLevelMouseHook(); _mouse.MessageIntercepted += Hook.MouseHook; _mouse.StartHook(); }
private void timer1_Tick(object sender, EventArgs e) { timer1.Enabled = false; if (llhook) { kbd = new LowLevelKeyboardHook(); mouse = new LowLevelMouseHook(); kbd.MessageIntercepted += new LowLevelMessageCallback(ll_MessageIntercepted); mouse.MessageIntercepted += new LowLevelMessageCallback(ll_MessageIntercepted); kbd.StartHook(); mouse.StartHook(); } else { rec = new JournalRecordHook(); rec.RecordEvent += new EventHandler<JournalRecordEventArgs>(rec_RecordEvent); rec.StartHook(); } }