AM电脑吧 - Win10精简版系统_Win11精简版_Win7旗舰版

Yes
查看: 5395|回复: 3
收起左侧

[其它] 分享AU3小技巧

[复制链接]
ampc8193

签到天数: 816 天

[LV.10]无所不能

id yinbinly 发表于 2011-05-20 18:39:21
  1. 1,开机(windows运行)时间:(By Gooker)
  2. $time = DllCall("kernel32.dll","int","GetTickCount")
  3. MsgBox(0,0,$time[0]/60000) ;$time[0]是window运行时间的毫秒数
  4. 2,根据文件扩展名取得相关图标(By 辣椒龙)
  5. 以txt文件为例。
  6. 1.找HKEY_CLASSES_ROOT\.txt下的默认键,值是“txtfile”。
  7. 2.找HKEY_CLASSES_ROOT\txtfile\DefaultIcon下的默认值,值是“%SystemRoot%\system32\shell32.dll,-152”。
  8. 逗号前是文件名(也可以是exe文件等),后是位置(正值为顺序号,负值为索引号)。
  9. 3,设置Combo内内容为不可更改(样式)(By chasedream)
  10. GUICtrlCreateCombo("", 32, 45, 145, 25,$SS_BLACKFRAME)
  11. 4,判断大写键盘灯亮还是灭(By Gooker)
  12. $result = DllCall("user32.dll","Int","GetKeyState","int",20)
  13. If @error = 1 Then
  14. MsgBox(0,"错误","函数调用失败") ;基本上不会的 :)
  15. Exit
  16. Else
  17. If $result[0] = 1 Then
  18. MsgBox(0,"大写键盘灯状态","亮")
  19. Else
  20. MsgBox(0,"大写键盘灯状态","灭")
  21. EndIf
  22. EndIf
  23. 5,调用迅雷下载(By thesnow)
  24. $obj=ObjCreate("ThunderAgent.Agent")
  25. ;$obj.Addtask("下载地址", "另存文件名", "保存目录","任务注释","引用地址","开始模式", "只从原始地址下载","从原始地址下载线程数") ;添加下载任务
  26. ;说明一下,开始模式只能为1(立即)/0(手动)/-1,只从原始地址下载请设置为真或者假(True/False)(1/0)
  27. $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);添加下载任务
  28. $obj.CommitTasks(1) ;提交任务.
  29. 6,查CPU温度(WMI)(By zcbenz)
  30. Dim $temp = ""
  31. While 1
  32. $objWMIService = ObjGet("winmgmts:\\.\root\WMI")
  33. $colItems = $objWMIService.ExecQuery("SELECT * FROM MSAcpi_ThermalZoneTemperature")
  34. $temp = ""
  35. For $objItem in $colItems
  36. $temp &= "CurrentTemperature: " & ($objItem.CurrentTemperature - 2732) / 10 & "°C" & @LF
  37. Next
  38. ToolTip(StringTrimRight($temp,1),100,0)
  39. $objWMIService = 0
  40. Sleep(5000)
  41. WEnd
  42. 7,调用放大镜的功能(By zcbenz)
  43. Global $SRCCOPY = 0x00CC0020
  44. Global $leave = 0
  45. HotKeySet("{PAUSE}","leave")
  46. SplashTextOn ( "AU3MAG", "" , 100 , 100 , 0, 0, 1 )
  47. $MyhWnd = WinGetHandle("AU3MAG")
  48. While Not $leave
  49. Sleep(25)
  50. MAG()
  51. WEnd
  52. Func MAG()
  53. $MyHDC = DLLCall("user32.dll","int","GetDC","hwnd",$MyhWnd)
  54. If @error Then Return
  55. $DeskHDC = DLLCall("user32.dll","int","GetDC","hwnd",0)
  56. If Not @error Then
  57. $xy = MouseGetPos()
  58. If Not @error Then
  59. $l = $xy[0]-10
  60. $t = $xy[1]-10
  61. 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)
  62. EndIf
  63. DLLCall("user32.dll","int","ReleaseDC","int",$DeskHDC[0],"hwnd",0)
  64. EndIf
  65. DLLCall("user32.dll","int","ReleaseDC","int",$MyHDC[0],"hwnd",$MyhWnd)
  66. EndFunc
  67. Func leave()
  68. $leave = 1
  69. EndFunc
  70. 7,打开我的电脑,定位到C盘(By 辣椒龙)
  71. Run(@WindowsDir & "\explorer.exe /e, /select,C:")
  72. 8,限制input框为数字和数量限制(By dyljf & 20ysbb)
  73. $Input1 = GUICtrlCreateInput("", 95, 205, 129, 21,$ES_NUMBER)
  74. GUICtrlSetLimit(-1, 9)
  75. 9,强制刷新组策略和注册表 (By redapple)
  76. xp/2003命令
  77. gpupdate /force
  78. 2k命令
  79. secedit /refreshpolicy machine_policy /enforce
  80. 10,获得进程路径 (By sanhen)
  81. Func Processpath($iPID)
  82. Local $aProc = DllCall('kernel32.dll', 'hwnd', 'OpenProcess', 'int', BitOR(0x0400, 0x0010), 'int', 0, 'int', $iPID)
  83. If $aProc[0] = 0 Then Return SetError(1, 0, '')
  84. Local $vStruct = DllStructCreate('int[1024]')
  85. DllCall('psapi.dll', 'int', 'EnumProcessModules', 'hwnd', $aProc[0], 'ptr', DllStructGetPtr($vStruct), 'int', DllStructGetSize($vStruct), 'int_ptr', 0)
  86. Local $aReturn = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'hwnd', $aProc[0], 'int', DllStructGetData($vStruct, 1), 'str', '', 'int', 2048)
  87. If StringLen($aReturn[3]) = 0 Then Return SetError(2, 0, '')
  88. Return $aReturn[3]
  89. EndFunc
复制代码

评分

参与人数 1带宽 +5 收起 理由
ampc81 + 5 很好的帖子,非常感谢.

本文地址: https://www.ampc8.com/thread-697-1-1.html
上一篇:DirectX 2011 04 运行库安装版
下一篇:自动安装脚本几个常用命令简介
回复

举报

ampc839210

签到天数: 271 天

[LV.8]八秒开机

id trhy1234567 发表于 2016-10-28 19:36:53
学习了,谢谢分享
回复

举报

ampc8242

签到: Lazy

id jkq920 发表于 2011-07-18 20:50:56
学习学习一下
回复

举报

ampc8193

签到天数: 816 天

[LV.10]无所不能

lz  楼主| yinbinly 发表于 2011-05-21 09:03:45
回复 2# zfyczyh


    $time = DllCall("kernel32.dll","int","GetTickCount")

MsgBox(0,0,$time[0]/60000) ;$time[0]是window运行时间的毫秒数
回复

举报

您需要登录后才可以回帖 登录 | 验证注册

Powered by AMpc8.Com (晋ICP备13003365号ghs 晋公网安备 14090202000112号 |GMT+8, 2024/3/30 16:48 |
快速回复 返回顶部 返回列表