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

Yes
查看: 6838|回复: 6
收起左侧

[其它] au3开机画面修改源码

[复制链接]
ampc81652

签到天数: 14 天

[LV.3]三流显示器

id 快乐100 发表于 2011-08-22 12:07:24
本帖最后由 快乐100 于 2011-8-23 10:39 编辑

au3开机画面修改源码

最近学AU3,做了个开机画面的修改工具,用于XP,通过常用的方法修改,大家想用就可以复制,不多说啦,上图:
1.jpg
选择好图片和启动时间就按“应用”,当然修改后可以按“还原”键还原,关键是你想不想还原了。修改后重启看看,变了吧。

源代码:

  1. #NoTrayIcon
  2. #Region ;**** 参数创建于 AutoIt3Wrapper_GUI ****
  3. #AutoIt3Wrapper_icon=D:\Program Files\AU3\Aut2Exe\Icons\apps.ico
  4. #AutoIt3Wrapper_outfile=开机画面修改工具.EXE
  5. #AutoIt3Wrapper_Compression=4
  6. #AutoIt3Wrapper_UseAnsi=y
  7. #AutoIt3Wrapper_Allow_Decompile=n
  8. #AutoIt3Wrapper_Res_Comment=博客地址:http://hi.baidu.com/辰cheng_  欢迎访问
  9. #AutoIt3Wrapper_Res_Description=开机画面修改
  10. #AutoIt3Wrapper_Res_Fileversion=1.0.0.0
  11. #AutoIt3Wrapper_Res_LegalCopyright=辰cheng制作
  12. #EndRegion ;**** 参数创建于 AutoIt3Wrapper_GUI ****
  13. #Region ;**** 参数创建于 ACNWrapper_GUI ****
  14. #EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
  15. #include <ButtonConstants.au3>
  16. #include <EditConstants.au3>
  17. #include <GUIConstantsEx.au3>
  18. #include <StaticConstants.au3>
  19. #include <WindowsConstants.au3>
  20. #Region ### START Koda GUI section ### Form=
  21. $Form1 = GUICreate("开机画面修改工具", 295, 140)
  22. $Label1 = GUICtrlCreateLabel("注意:请选择一张大小为640*480*16色的图片!", 24, 16, 262, 20)
  23. GUICtrlSetTip(-1, "在Photoshop中新建一个大小640*480全黑的图层做背景" & @CRLF & "然后将自己喜欢的图片放到黑色的图层上图片模式改为索引"& @CRLF &"保存时选择16色(即4位)bmp图片")
  24. GUICtrlSetCursor(-1, 0)
  25. GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
  26. GUICtrlSetColor(-1, 0x800000)
  27. $Input1 = GUICtrlCreateInput("", 24, 48, 201, 21)
  28. $Button1 = GUICtrlCreateButton("选 择", 228, 47, 38, 21, $WS_GROUP)
  29. $Label2 = GUICtrlCreateLabel("启动菜单等待时间(秒):", 24, 80, 129, 17)
  30. $Input2 = GUICtrlCreateInput("3", 152, 78, 33, 17)
  31. $Button2 = GUICtrlCreateButton("应 用", 24, 110, 75, 22, $WS_GROUP)
  32. $Button3 = GUICtrlCreateButton("还 原", 152, 110, 75, 22, $WS_GROUP)
  33. GUICtrlSetState(-1, $GUI_DISABLE)
  34. $Label3 = GUICtrlCreateLabel("辰cheng", 232, 116, 46, 17)
  35. GUICtrlSetState(-1, $GUI_DISABLE)
  36. GUISetState(@SW_SHOW)
  37. #EndRegion ### END Koda GUI section ###
  38. $Win = Stringtrimleft(@windowsdir, 3)
  39. if regread("HKLM\SYSTEM\CurrentControlSet\Control", "SystemBootDevice") = '' then
  40.         $default = "multi(0)disk(0)rdisk(0)partition(1)" & $Win
  41. else
  42.         $default = regread("HKLM\SYSTEM\CurrentControlSet\Control", "SystemBootDevice") & "" & $Win
  43. endif
  44. $Result = iniread(@homedrive & "\boot.ini", "operating systems", $default, "")
  45. $addresult = $Result & " /bootlogo /noguiboot"
  46. If FileExists(@WindowsDir & "\boot.bmp")  And  Stringinstr($Result, "/bootlogo /noguiboot") then
  47.    GUICtrlSetState($Button3, $GUI_ENABLE)
  48. EndIf
  49. While 1
  50.         $nMsg = GUIGetMsg()
  51.         Switch $nMsg
  52.                 Case $GUI_EVENT_CLOSE
  53.                         Exit
  54.                 Case $Button1
  55.                         $ButtonInput1 = FileOpenDialog("", "", "(*.bmp)", "9")
  56.                         GUICtrlSetData($Input1, $ButtonInput1)
  57.                 Case $Button2
  58.       GUICtrlSetState($Button2, $GUI_DISABLE)
  59.                         GUICtrlSetState($Button3, $GUI_DISABLE)
  60.                         FileCopy(GUICtrlRead($Input1), @WindowsDir & "\boot.bmp", 1)
  61.                         FileSetAttrib(@HomeDrive & "\boot.ini", "-HSR")
  62.                         if Stringinstr($Result, $addresult) = 0 then
  63.                         iniwrite(@homedrive & "\boot.ini", "operating systems", $default, $addresult)
  64.                         EndIf
  65.                     iniwrite(@homedrive & "\boot.ini", "boot loader", "timeout", GUICtrlRead($Input2))
  66.                         FileSetAttrib(@WindowsDir & "\boot.bmp", "+HSR")
  67.                         FileSetAttrib(@HomeDrive & "\boot.ini", "+HSR")
  68.                         WinWaitActive("开机画面修改工具")
  69.             WinSetTitle("开机画面修改工具", "", "设置完毕请重启计算机查看效果")
  70.                 Case $Button3
  71.                         GUICtrlSetState($Button2, $GUI_DISABLE)
  72.                         GUICtrlSetState($Button3, $GUI_DISABLE)
  73.                         FileSetAttrib(@WindowsDir & "\boot.bmp", "-HSR")
  74.                         FileDelete (@WindowsDir & "\boot.bmp")
  75.                         FileSetAttrib(@HomeDrive & "\boot.ini", "-HSR")
  76.             $var=IniReadSection (@homedrive & "\boot.ini", "operating systems")
  77.             ;MsgBox(4096, "", "关键字: " & $var[1][0] & @CRLF & "值: " & $var[1][1])
  78.             $qqq=StringTrimRight ($var[1][1], 20)
  79.             IniWrite(@homedrive & "\boot.ini", "operating systems", $var[1][0],$qqq)
  80.                         FileSetAttrib(@HomeDrive & "\boot.ini", "+HSR")
  81.                         WinWaitActive("开机画面修改工具")
  82.             WinSetTitle("开机画面修改工具", "", "设置完毕请重启计算机查看效果")
  83.         EndSwitch
  84. WEnd

复制代码

评分

参与人数 2硬盘 +15 带宽 +20 收起 理由
ampc8110 fuldho + 5 + 10 原创内容,再接再厉.
ampc84 admin + 10 + 10 原创内容

本文地址: https://www.ampc8.com/thread-3128-1-1.html
上一篇:卡饭论坛病毒测试组2011年8月21日杀毒软件测试成绩
下一篇:搜狗手机输入法Android平台1.6.2版本发布
回复

举报

ampc839210

签到天数: 271 天

[LV.8]八秒开机

id trhy1234567 发表于 2016-06-22 18:10:00
学习,支持,感谢分享
回复

举报

ampc824158

签到天数: 16 天

[LV.4]四枚内存条

id ti1124 发表于 2014-10-08 13:57:46
值得推荐
回复

举报

ampc824284

签到天数: 24 天

[LV.4]四枚内存条

id a290450620 发表于 2014-09-16 20:36:20
希望有win7的..
回复

举报

ampc88690

签到: Lazy

id zqqdnb 发表于 2012-07-20 13:20:23
值得学习,先收藏
回复

举报

头像被屏蔽

签到天数: 9 天

[LV.3]三流显示器

id jsgh1983 发表于 2012-03-11 18:50:02
学习了!感觉还不错,谢谢楼主分享!
回复

举报

ampc84

签到天数: 15 天

[LV.4]四枚内存条

id ②號 发表于 2011-08-22 12:35:51
只要是原创内容,就值得推荐。
回复

举报

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

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