0

how to use this lib to hook key and mouse to target process not global not my app

public void Subscribe()
{
    // Note: for the application hook, use the Hook.AppEvents() instead
    m_GlobalHook = Hook.GlobalEvents();

    m_GlobalHook.MouseDownExt += GlobalHookMouseDownExt;
    m_GlobalHook.KeyPress += GlobalHookKeyPress;
}

// Note: for the application hook, use the Hook.AppEvents() instead

but how to get the target app or process ?

  • 1
    The library you use does not give you the option to hook a specific process. So you have to do it the other way around, in your event handler find out which process is in the foreground. https://stackoverflow.com/questions/6569405/how-to-get-active-process-name-in-c – Hans Passant Mar 04 '18 at 21:20
  • Thanx for replay. I did it with this way but i hoped there is away to target selected process – Black Ghost Mar 09 '18 at 15:11

0 Answers0