AutoIt v3 (*.au3)
Dim $i = 30 ;<== strat blockinput
$btn = MsgBox(36, "BlockInput confirm", "ท่านต้องการล๊อคเม๊าท์และคีย์บอร์ดใช่หรือไม่?")
If $btn = 7 Then Exit
Do
$i -= 1
BlockInput(1)
ToolTip("Locking.. mouse and keybroad. Please wait! 30 sec.. Remain: " & $i & " sec")
Sleep(1000)
Until $i <= 0
BlockInput(0) ;<== end blockinput==========================================================
VB.Net ใช้คำสั่ง ObjectCom และ AutoItX3.dll
Imports AutoItX3Lib
Public Class Form1
Private Sub Form1_Shown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Shown
Dim btn As String
btn = MsgBox("ท่านต้องการล๊อคเมีาท์และคีย์บอร์ดใช่หรือไม่", 36, "BlockInput confirm")
If btn = vbNo Then Exit Sub
Dim oAutoIt As New AutoItX3
Dim i As Integer = 30
Do Until i <= 0
i -= 1
oAutoIt.BlockInput(1)
oAutoIt.ToolTip("Locking..mouse and keybroad. Please wait!..Remain: " & i & " sec")
oAutoIt.Sleep(1000)
Loop
oAutoIt.ToolTip("")
oAutoIt.BlockInput(0)
End Sub
End Class=============================================================
JavaScript (*.js)
var ShellObj=new ActiveXObject("WScript.Shell");
var oAutoIt=new ActiveXObject("AutoItX3.Control");
var btn = ShellObj.Popup("ท่านต้องการล๊อคเม๊าท์และคีย์บอร์ดใช่หรือไม่?", 0, "BlockInput confirm", 36);
if ( btn == 6 ){
var i = 0;
while (i <= 30){
oAutoIt.BlockInput(1);
oAutoIt.ToolTip("Please wait! 30 sec. Maintime: " + i + " sec");
WScript.Sleep(1000);
if (i == 30){
oAutoIt.BlockInput(0);
break;
}
i++;
}
}