鎖住鍵盤及滑鼠的輸入 API

  • 1300
  • 0

鎖住鍵盤及滑鼠的輸入 API

Blocks keyboard and mouse input events from reaching applications 參考MSDN

   1:          [DllImport("user32.dll")]   
   2:           static extern void BlockInput(bool Block);
   3:   
   4:          private void button1_Click(object sender, EventArgs e)
   5:          {
   6:              BlockInput(false); 
   7:              System.Threading.Thread.Sleep(10000);   
   8:              BlockInput(true); 
   9:          }