Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DeviceID:="HID\VID_046D&PID_C08F&MI_01&COL05\7&FA279E4&0&0005"
- ; 檢測是否有此 DeviceID
- ; ================================================
- PnPSignedDriver := Win32_PnPSignedDriver()
- is_device_found:=FALSE
- for i, v in PnPSignedDriver
- if (PnPSignedDriver[i].DeviceID=DeviceID){
- is_device_found:=TRUE
- }
- if not (is_device_found){
- MsgBox, 0, Error, 未找到 DeviceID,退出腳本...
- ExitApp
- }
- MsgBox, 0, Info, 已找到 DeviceID,腳本開始運行
- ; 主要腳本
- ; ================================================
- F8::MsgBox, Hello World!
- ; 基本函數區塊
- ; ============================================================
- Win32_PnPSignedDriver()
- {
- try
- {
- PnPSignedDriver := []
- for objItem in ComObjGet("winmgmts:").ExecQuery("SELECT * FROM Win32_PnPSignedDriver")
- {
- PnPSignedDriver[A_Index, "Description"] := objItem.Description
- PnPSignedDriver[A_Index, "DeviceID"] := objItem.DeviceID
- }
- return PnPSignedDriver
- }
- return ""
- }
- EM_SETCUEBANNER(handle, string, option := true)
- {
- static ECM_FIRST := 0x1500
- static EM_SETCUEBANNER := ECM_FIRST + 1
- if (DllCall("user32\SendMessage", "ptr", handle, "uint", EM_SETCUEBANNER, "int", option, "str", string, "int"))
- return true
- return false
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement