You can also use the GAPI. Theres a function called GXOpenInput() and
GXCloseInput().
GXCloseInput - Turns on the unfiltered button message mode. All hardware
button presses generate appropriate WM_KEY messages to the application and
are not sent to the shell.
GXOpenInput - returns button-press messages to their filtered mode.
You can call it from managed code by:
public static bool LockHardwareButtons() {
try {
GXOpenInput();
return true;
}
catch (MissingMethodException) {
return false;
}
}
public static bool UnlockHardwareButtons() {
try {
GXCloseInput();
return true;
}
catch (MissingMethodException) {
return false;
}
}
[DllImport("gx.dll", EntryPoint = "#9")]
private static extern int GXOpenInput();
[DllImport("gx.dll", EntryPoint = "#3")]
private static extern int GXCloseInput();
--
Best Regards,
Christian R. Helle
http://christian-helle.blogspot.com
Simon Hart said:
If the device supports key lock you could force a keyboard event:
keybd_event(0x85, 0, 0, 0);
[DllImport("coredll.dll", EntryPoint = "keybd_event", SetLastError =
true)]
internal static extern void keybd_event(byte bVk, byte bScan, int
dwFlags, int dwExtraInfo);
See the key codes here:
http://msdn.microsoft.com/en-us/library/bb431750.aspx
There might be a better way, but this works as I just tested it on my
devices.
--
Simon Hart
Visual Developer - Device Application Development MVP
http://simonrhart.blogspot.com
juvi said:
Hello,
Is it possible to lock screen and keys and unlock them with an unlock
method.....have no idea for that.....thx juvi