找回密码
 加入
搜索
查看: 36712|回复: 99

Autoit3小技巧集合

 火... [复制链接]
发表于 2010-4-27 16:38:46 | 显示全部楼层 |阅读模式
1,开机(windows运行)时间:(By Gooker)
$time = DllCall("kernel32.dll","int","GetTickCount")
MsgBox(0,0,$time[0]/60000) ;$time[0]是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[0] = 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[0]-10
$t = $xy[1]-10
DLLCall("gdi32.dll","int","StretchBlt","int",$MyHDC[0],"int",0,"int",0,"int",100,"int",100,"int",$DeskHDC[0],"int", $l,"int",$t,"int",20,"int",20,"long",$SRCCOPY)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$DeskHDC[0],"hwnd",0)
EndIf
DLLCall("user32.dll","int","ReleaseDC","int",$MyHDC[0],"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] = 0 Then Return SetError(1, 0, '')
Local $vStruct = DllStructCreate('int[1024]')
DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
Return $aReturn[3]
EndFunc
发表于 2010-4-27 21:34:17 | 显示全部楼层
刷钱啊刷钱啊刷钱啊

评分

参与人数 1金钱 -100 收起 理由
guland -100 恶意灌水,扣分警告!

查看全部评分

发表于 2010-4-27 21:34:23 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:27 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:32 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:36 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:39 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:43 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-4-27 21:34:48 | 显示全部楼层
刷钱啊刷钱啊刷钱啊
发表于 2010-5-4 16:27:04 | 显示全部楼层
好东西收藏一下。
发表于 2010-5-4 20:39:26 | 显示全部楼层
不错 一些小技巧
发表于 2010-5-8 23:14:32 | 显示全部楼层
写写不错啊
上面的 你这样刷帖
死得早跟你说
发表于 2010-5-10 11:12:56 | 显示全部楼层
支持技巧类文章,感谢楼主
发表于 2010-5-10 16:51:09 | 显示全部楼层
不错,很实用的文章,特别对于我们新手而言..
发表于 2010-5-13 20:22:28 | 显示全部楼层
很实用的小技巧,收藏了。谢谢。
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-11-16 17:57 , Processed in 0.071933 second(s), 20 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表