Micki-Weaver
asked on
kill keyboard mouse
how do I lock the keyboard off in .Net
also the mouse
also the mouse
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You can use BlockInput API.
ASKER
it turns out you can use 2 and 7 I think, I'll put up the code:) next day
Hi,
Are you looking for something which could process the keyboard and mouse events in the windows form and ignore them?
Can you please explain me?
thanks,
Vaz
Are you looking for something which could process the keyboard and mouse events in the windows form and ignore them?
Can you please explain me?
thanks,
Vaz
ASKER
class Class1
{
static System.IntPtr hhookMoues = System.IntPtr.Zero;
static System.IntPtr hhookKeyboard = System.IntPtr.Zero;
[System.Runtime.InteropSer vices.DllI mport("ker nel32.dll" )]
static extern System.IntPtr LoadLibrary(string lpFileName);
[System.Runtime.InteropSer vices.DllI mport("use r32.dll")]
static extern System.IntPtr SetWindowsHookEx(int idHook, keyboardHookProc callback, System.IntPtr hInstance, uint threadId);
public void flip()
{
/// <summary>
/// Loads the library.
/// </summary>
/// <param name="lpFileName">Name of the library</param>
/// <returns>A handle to the library</returns>
hhookKeyboard = SetWindowsHookEx(WH_KEYBOA RD_LL, hookProc, hInstance, 1);
hhookMoues = SetWindowsHookEx(WH_MOUSE_ LL, hookProc, hInstance, 1);
}
public static bool LockDownAppSpecific;
static int WH_KEYBOARD_LL
{
get
{
if (LockDownAppSpecific)
return 2;
else
return 13;
}
}
static int WH_MOUSE_LL
{
get
{
if (LockDownAppSpecific)
return 7;
else
return 14;
}
}
}
}
{
static System.IntPtr hhookMoues = System.IntPtr.Zero;
static System.IntPtr hhookKeyboard = System.IntPtr.Zero;
[System.Runtime.InteropSer
static extern System.IntPtr LoadLibrary(string lpFileName);
[System.Runtime.InteropSer
static extern System.IntPtr SetWindowsHookEx(int idHook, keyboardHookProc callback, System.IntPtr hInstance, uint threadId);
public void flip()
{
/// <summary>
/// Loads the library.
/// </summary>
/// <param name="lpFileName">Name of the library</param>
/// <returns>A handle to the library</returns>
hhookKeyboard = SetWindowsHookEx(WH_KEYBOA
hhookMoues = SetWindowsHookEx(WH_MOUSE_
}
public static bool LockDownAppSpecific;
static int WH_KEYBOARD_LL
{
get
{
if (LockDownAppSpecific)
return 2;
else
return 13;
}
}
static int WH_MOUSE_LL
{
get
{
if (LockDownAppSpecific)
return 7;
else
return 14;
}
}
}
}
ASKER
this lock a app or the system from mouse and keyboard
ASKER