Autoit3小技巧集合
1,开机(windows运行)时间:(By Gooker)$time = DllCall("kernel32.dll","int","GetTickCount")
MsgBox(0,0,$time/60000) ;$time是window运行时间的毫秒数
2,根据文件扩展名取得相关图标(By 辣椒龙)
以txt文件为例。
1.找HKEY_CLASSES_ROOT\.txt下的默认键,值是“txtfile”。
2.找HKEY_CLASSES_ROOT\txtfile\DefaultIcon下的默认值,值是“%SystemRoot%\system32\shell32.dll,-152”。
逗号前是文件名(也可以是exe文件等),后是位置(正值为顺序号,负值为索引号)。
3,设置Combo内内容为不可更改(样式)(By chasedream)
GUICtrlCreateCombo("", 32, 45, 145, 25,$SS_BLACKFRAME)
4,判断大写键盘灯亮还是灭(By Gooker)
$result = DllCall("user32.dll","Int","GetKeyState","int",20)
If @error = 1 Then
MsgBox(0,"错误","函数调用失败") ;基本上不会的 :)
Exit
Else
If $result = 1 Then
MsgBox(0,"大写键盘灯状态","亮")
Else
MsgBox(0,"大写键盘灯状态","灭")
EndIf
EndIf
5,调用迅雷下载(By thesnow)
$obj=ObjCreate("ThunderAgent.Agent")
;$obj.Addtask("下载地址", "另存文件名", "保存目录","任务注释","引用地址","开始模式", "只从原始地址下载","从原始地址下载线程数") ;添加下载任务
;说明一下,开始模式只能为1(立即)/0(手动)/-1,只从原始地址下载请设置为真或者假(True/False)(1/0)
$obj.AddTask("http://www.autoitx.com/autoitv3/3.2.5.5.1.exe","X.EXE","C:\TDOWNLOAD","3.2.5.5.1","dddd",1,1,10);添加下载任务
$obj.CommitTasks(1) ;提交任务.
6,查CPU温度(WMI)(By zcbenz)
Dim $temp = ""
While 1
$objWMIService = ObjGet("winmgmts:\\.\root\WMI")
$colItems = $objWMIService.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature")
$temp = ""
For $objItem in $colItems
$temp &= "CurrentTemperature: " & ($objItem.CurrentTemperature - 2732) / 10 & "°C" & @LF
Next
ToolTip(StringTrimRight($temp,1),100,0)
$objWMIService = 0
Sleep(5000)
WEnd
7,调用放大镜的功能(By zcbenz)
Global $SRCCOPY = 0x00CC0020
Global $leave = 0
HotKeySet("{PAUSE}","leave")
SplashTextOn ( "AU3MAG", "" , 100 , 100 , 0, 0, 1 )
$MyhWnd = WinGetHandle("AU3MAG")
While Not $leave
Sleep(25)
MAG()
WEnd
Func MAG()
$MyHDC = DLLCall("user32.dll","int","GetDC","hwnd",$MyhWnd)
If @error Then Return
$DeskHDC = DLLCall("user32.dll","int","GetDC","hwnd",0)
If Not @error Then
$xy = MouseGetPos()
If Not @error Then
$l = $xy-10
$t = $xy-10
DLLCall("gdi32.dll","int","StretchBlt","int",$MyHDC,"int",0,"int",0,"int",100,"int",100,"int",$DeskHDC,"int", $l,"int",$t,"int",20,"int",20,"long",$SRCCOPY)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$DeskHDC,"hwnd",0)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$MyHDC,"hwnd",$MyhWnd)
EndFunc
Func leave()
$leave = 1
EndFunc
7,打开我的电脑,定位到C盘(By 辣椒龙)
Run(@WindowsDir & "\explorer.exe /e, /select,C:\")
8,限制input框为数字和数量限制(By dyljf & 20ysbb)
$Input1 = GUICtrlCreateInput("", 95, 205, 129, 21,$ES_NUMBER)
GUICtrlSetLimit(-1, 9)
9,强制刷新组策略和注册表 (By redapple)
xp/2003命令
gpupdate /force
2k命令
secedit /refreshpolicy machine_policy /enforce
10,获得进程路径 (By sanhen)
Func Processpath($iPID)
Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
If $aProc = 0 Then Return SetError(1, 0, '')
Local $vStruct = DllStructCreate('int')
DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc, 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc, 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
If StringLen($aReturn) = 0 Then Return SetError(2, 0, '')
Return $aReturn
EndFunc 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 刷钱啊刷钱啊刷钱啊 好东西收藏一下。 不错 一些小技巧 写写不错啊
上面的 你这样刷帖
死得早跟你说 支持技巧类文章,感谢楼主 不错,很实用的文章,特别对于我们新手而言.. 很实用的小技巧,收藏了。谢谢。