1. 問題或需求描述:
熱鍵調用三方程序
2.解決方法:
使用 AutoIt3 腳本語言,可以快速編寫出熱鍵主調程序。
3.例如:
利用熱鍵調用三方程序,實現特定需要。例程中,我們實現按 “F4”鍵時調起三方程序,實現清除電腦上的所有藍牙連接等功能。
au3代碼:
If WinExists("firswof-clearbt") Then Exit
GUICreate("firswof-clearbt")
HotKeySet ( "{ESC}" , "_Exit")
HotKeySet ( "{F2}" , "_ShutAllConsole")
HotKeySet ( "{F3}" , "_RestartBT")
HotKeySet ( "{F4}" , "_ClearBT")
ToolTip("[ESC:退出;F4:清除藍牙]", 0, 0)
While (1)
Sleep(60000)
WEnd
Func _Exit()
Exit
EndFunc
Func _ClearBT()
ShellExecute ( "E:\BT_Pair.exe" , " -u" , "")
EndFunc
Func _RestartBT()
ShellExecute ( "E:\BT_Pair.exe" , " -r" , "")
EndFunc
Func _ShutAllConsole()
ShellExecute ( "E:\BT_Pair.exe" , " -a" , "")
EndFunc