Compare commits
8 Commits
Author | SHA1 | Date |
---|---|---|
paring | 85e1a67bce | |
paring | df595443a5 | |
paring | fdbcf0d031 | |
paring | c44be95ca0 | |
paring | 8f96fc8bf0 | |
paring | 99817cd203 | |
paring | c11f32ae68 | |
paring | e88599102c |
|
@ -31,7 +31,7 @@ namespace SkyHook
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether the hook is active now.
|
/// Whether the hook is active now.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool isHookActive;
|
public bool isHookActive => SkyHookNative.HookIsRunning();
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Your callback for each key updated events.
|
/// Your callback for each key updated events.
|
||||||
|
@ -96,7 +96,6 @@ namespace SkyHook
|
||||||
exception = new SkyHookException(result);
|
exception = new SkyHookException(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
isHookActive = true;
|
|
||||||
started = true;
|
started = true;
|
||||||
|
|
||||||
_mre.WaitOne();
|
_mre.WaitOne();
|
||||||
|
@ -113,6 +112,7 @@ namespace SkyHook
|
||||||
|
|
||||||
while (!started && exception == null)
|
while (!started && exception == null)
|
||||||
{
|
{
|
||||||
|
Thread.Yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (exception != null)
|
if (exception != null)
|
||||||
|
@ -134,8 +134,6 @@ namespace SkyHook
|
||||||
{
|
{
|
||||||
_mre.Set();
|
_mre.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
isHookActive = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -29,5 +29,12 @@ namespace SkyHook
|
||||||
/// <returns><c>null</c> if no error, or an error message.</returns>
|
/// <returns><c>null</c> if no error, or an error message.</returns>
|
||||||
[DllImport(Lib, EntryPoint = "stop_hook", CallingConvention = CallingConvention.Cdecl)]
|
[DllImport(Lib, EntryPoint = "stop_hook", CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern string StopHook();
|
public static extern string StopHook();
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The native version of <see cref="SkyHookManager.StopHook"/> method handled by <see cref="SkyHookManager"/>.
|
||||||
|
/// </summary>
|
||||||
|
/// <returns><c>null</c> if no error, or an error message.</returns>
|
||||||
|
[DllImport(Lib, EntryPoint = "hook_is_running", CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern bool HookIsRunning();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue