我需要在我的應用程序的系統級別禁用特定時間段內的鍵盤/鼠標或兩者。在c中禁用鍵盤/鼠標
我有以下這樣做
public partial class NativeMethods
{
/// Return Type: BOOL->int
///fBlockIt: BOOL->int
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint = "BlockInput")]
[return: System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)]
public static extern bool BlockInput([System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.Bool)] bool fBlockIt);
}
通過這個代碼的任務就完成了,但是當CTRL + ALT + DELETE鍵盤和鼠標的用戶點擊的再次合作。 任何機構可以告訴我如何制止這種情況嗎?
您無法停止CTRL + ALT + DEL的發生。 – Alex
這聽起來很明顯,但如果您處於需要這種情況的場景,也許只需拔掉鼠標和鍵盤將是更好的選擇。當然,除非你正在編寫一個rootkit,否則我懷疑有人會幫助你。 –
你想通過禁用鍵盤和鼠標來解決什麼具體問題? – cadrell0