找回密码
 加入
搜索
查看: 5317|回复: 10

[AU3基础] [已解决]如何在au3程序中添加MID背景音乐

  [复制链接]
发表于 2010-4-20 17:50:11 | 显示全部楼层 |阅读模式
本帖最后由 515889127 于 2010-4-21 00:07 编辑

请问各位大大 如何在au3程序中添加MID背景音乐呢?

评分

参与人数 1金钱 +10 收起 理由
afan + 10 感谢主动将修改帖子分类为[已解决],请继续 ...

查看全部评分

发表于 2010-4-20 18:24:20 | 显示全部楼层
SoundPlay('.mid文件')
 楼主| 发表于 2010-4-21 00:06:35 | 显示全部楼层
回复 2# afan
谢谢
发表于 2010-4-25 00:55:50 | 显示全部楼层
学习了。。我也试试去
发表于 2010-5-6 08:16:40 | 显示全部楼层
回复 2# afan

soundplay(".mid",1)单放好使,为什么把它加入其他AU3中就不播放了呢?
发表于 2010-5-6 10:29:42 | 显示全部楼层
回复 5# newuser


    你是怎样加入其它AU3中播放的?
发表于 2010-5-6 12:12:47 | 显示全部楼层
回复 6# afan
它不是逐行执行吗?
密码:Mynameiszgk
#Region ;**** 参数创建于 ACNWrapper_GUI ****
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_Au3Check_Stop_OnWarning=y
#AutoIt3Wrapper_Run_Tidy=y
#Obfuscator_Parameters=/striponly
#EndRegion ;**** 参数创建于 ACNWrapper_GUI ****
;######密码版的系统工具####################
;问题1:为什么不加While循环,界面会一闪而过?---感谢水木子
;答:如果不加While循环,代码一直执行到完毕,界面肯定一闪而过,
;    并且水木子老师建议不要sleep(1),那样延迟时间短执行过快CPU会受不了的!这都是经验啊!

;进行密码验证
_CheckPassWords()

Opt("GUIOnEventMode", 1) ;采用事件模式响应
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=

soundplay("Mus_24.mid",1)

$Form1 = GUICreate("系统工具集 ", 631, 454, 192, 114)
$Group1 = GUICtrlCreateGroup(".exe类", 48, 32, 169, 305)
$Button2 = GUICtrlCreateButton("Windows更新程序", 64, 56, 137, 33)
$Button3 = GUICtrlCreateButton("远程桌面", 64, 96, 137, 33)
$Button4 = GUICtrlCreateButton("系统信息", 64, 136, 137, 33)
$Button5 = GUICtrlCreateButton("文件签名验证程序", 64, 176, 137, 33)
$Button6 = GUICtrlCreateButton("任务管理器", 64, 216, 137, 33)
$Button7 = GUICtrlCreateButton("系统配置实用程序", 64, 256, 137, 33)
$Button8 = GUICtrlCreateButton("磁盘垃圾清理", 64, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(".msc类", 232, 32, 169, 305)
$Button9 = GUICtrlCreateButton("本地服务设置", 248, 56, 137, 33)
$Button10 = GUICtrlCreateButton("共享文件夹管理器", 248, 96, 137, 33)
$Button11 = GUICtrlCreateButton("磁盘碎片整理", 248, 136, 137, 33)
$Button12 = GUICtrlCreateButton("计算机管理", 248, 176, 137, 33)
$Button13 = GUICtrlCreateButton("磁盘管理", 248, 216, 137, 33)
$Button14 = GUICtrlCreateButton("本地安全设置", 248, 256, 137, 33)
$Button15 = GUICtrlCreateButton("设备管理器", 248, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup(".cpl类(控制面板)", 416, 32, 169, 305)
$Button16 = GUICtrlCreateButton("系统属性", 432, 56, 137, 33)
$Button17 = GUICtrlCreateButton("用户帐户", 432, 96, 137, 33)
$Button18 = GUICtrlCreateButton("自动更新", 432, 136, 137, 33)
$Button19 = GUICtrlCreateButton("网络连接", 432, 176, 137, 33)
$Button20 = GUICtrlCreateButton("区域和语言选项", 432, 216, 137, 33)
$Button21 = GUICtrlCreateButton("添加/删除程序", 432, 256, 137, 33)
$Button22 = GUICtrlCreateButton("Internet属性", 432, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("以上工具也可通过运行执行", 48, 352, 537, 65)
$Input1 = GUICtrlCreateInput("", 64, 376, 337, 21)
$Button1 = GUICtrlCreateButton("运行", 416, 368, 105, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("感谢hynq2000!仅为练手使用---采十青青橄榄  2010.4.27", 216, 424, 320, 66)
$Group5 = GUICtrlCreateGroup("", 32, 20, 569, 455)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

;###########进行事件关联##############
GUISetOnEvent($gui_event_close, "_Exit") ;错误:将  $ 写成 @
GUICtrlSetOnEvent($Button2, "_SysTools") ;点击$Button2,函数_SysTools响应,注意,不需要书写_SysTools(),而且要用" "将函数括起来
GUICtrlSetOnEvent($Button3, "_SysTools") ;另外注意是GUICtrlSetOnEvent(),不是GUISetOnEvent(),人家可是控件啊 !
GUICtrlSetOnEvent($Button4, "_SysTools")
GUICtrlSetOnEvent($Button5, "_SysTools")
GUICtrlSetOnEvent($Button6, "_SysTools")
GUICtrlSetOnEvent($Button7, "_SysTools")
GUICtrlSetOnEvent($Button8, "_SysTools")
GUICtrlSetOnEvent($Button9, "_SysTools")
GUICtrlSetOnEvent($Button10, "_SysTools")
GUICtrlSetOnEvent($Button11, "_SysTools")
GUICtrlSetOnEvent($Button12, "_SysTools")
GUICtrlSetOnEvent($Button13, "_SysTools")
GUICtrlSetOnEvent($Button14, "_SysTools")
GUICtrlSetOnEvent($Button15, "_SysTools")
GUICtrlSetOnEvent($Button16, "_SysTools")
GUICtrlSetOnEvent($Button17, "_SysTools")
GUICtrlSetOnEvent($Button18, "_SysTools")
GUICtrlSetOnEvent($Button19, "_SysTools")
GUICtrlSetOnEvent($Button20, "_SysTools")
GUICtrlSetOnEvent($Button21, "_SysTools")
GUICtrlSetOnEvent($Button22, "_SysTools")
GUICtrlSetOnEvent($Button1, "_SysTools")
;###########事件关联完毕##############

;###########进入##############
;注意:没有这个循环,界面是一闪而过
While 1
        Sleep(250)
WEnd
;###########主循环完毕##############

;###########定义响应事件的函数##############
Func _SysTools()
        Switch @GUI_CtrlId ;这是事件模式,别忘了消息模式是 Switch @GUIGetMsg()
                Case $Button2 ;开始执行系统的exe文件,一般它们都在  \system32目录下
                        Run(@SystemDir & "\wupdmgr.exe")
                Case $Button3
                        Run(@SystemDir & "\mstsc.exe")
                Case $Button4
                        Run(@SystemDir & "\winmsd.exe")
                Case $Button5
                        Run(@SystemDir & "\sigverif.exe")
                Case $Button6
                        Run(@SystemDir & "\taskmgr.exe")
                Case $Button7
                        Run(@WindowsDir & "\pchealth\helpctr\binaries\Msconfig.exe") ;msconfig命令不在\system32目录下
                        ;Run(@SystemDir&"\tsshutdn.exe") 它是60秒倒计时关机命令
                Case $Button8
                        Run(@SystemDir & "\cleanmgr.exe")
                Case $Button9 ;开始执行系统的msc文件,一般它们都在  \system32目录下,通过shellexecute执行它们
                        ShellExecute(@SystemDir & "\services.msc")
                Case $Button10
                        ShellExecute(@SystemDir & "\fsmgmt.msc")
                Case $Button11
                        ShellExecute(@SystemDir & "\dfrg.msc")
                Case $Button12
                        ShellExecute(@SystemDir & "\compmgmt.msc")
                Case $Button13
                        ShellExecute(@SystemDir & "\diskmgmt.msc")
                Case $Button14
                        ShellExecute(@SystemDir & "\secpol.msc")
                Case $Button15
                        ShellExecute(@SystemDir & "\devmgmt.msc")
                Case $Button16 ;开始执行系统的cpl文件,一般它们都在  \system32目录下,通过control来执行.cpl文件
                        Run("control sysdm.cpl")
                Case $Button17
                        Run("control userpasswords2")
                        ;Run("control nusrmgr.cpl"),不知道为什么它不好使!
                Case $Button18
                        Run("control wuaucpl.cpl")
                Case $Button19
                        Run("control ncpa.cpl")
                Case $Button20
                        Run("control intl.cpl")
                Case $Button21
                        Run("control appwiz.cpl")
                Case $Button22
                        Run("control inetcpl.cpl")
                Case $Button1 ;执行 “运行” 按钮
                        Run('cmd /c' & GUICtrlRead($Input1)) ;刚开始,$Button1就是没有反映,原来是忘记将其进行事件关联了
                        ;RunWait(@ComSpec&" /c "&GUICtrlRead($Input1)) ;参数  /c 表示要执行后面的“命令字符串”,而字符串是来自控件$input1内的内容
                        ;问题2:输入 msconfig 怎么不执行呢?
                        ;答:笨蛋!它不在/system32目录下,必须输入绝对路径才能执行,要不然再修改Path把msconfig所在的目录也加上
                        ;问题3:如何执行tasklist后让出现的窗口定住呢?Run('cmd /c pause')只是又打开一个DOS的暂停窗口啊?
                        ;答:其实在$input1内输入“tasklist & pause"就实现了,不过这还是DOS啊!
                        ;cmd /V:ON  启用“延迟变量”的意思!
        EndSwitch
EndFunc   ;==>_SysTools
;###########响应事件的函数结束##############

;###########定义验证密码的函数##############
Func _CheckPassWords()
        Local $MyPassWords = "MynameisZGK"
        $InputPassWords = InputBox("密码验证", "请输入密码:", "", "*", 200, 100, @DesktopWidth - 600, @DesktopHeight - 450, 20)
        ;InputBox("标题","提示","默认内容","密码字符","宽","高","左窗口距离","上窗口距离","密码输入延迟时间")
        ;*就是让输入的密码字符以星号显示
        ;@DesktopWidth-600,@DesktopHeight-450,就是让密码输入框居中显示
        If @error = 0 Then ;@error=0表示返回的字符串有效
                If $InputPassWords <> $MyPassWords Then
                        MsgBox(262144 + 32, "真遗憾!!!", "密码错了,想不起来了?", 9)
                        _Exit()
                Else ;密码检查通过
                        $InputPassWords = "" ;进入工具操作界面并清空输入的密码
                EndIf
        ElseIf @error = 1 Then ;@error=1表示用户按了Cancel按钮
                MsgBox(262144 + 32, "", "用户按了取消按钮")
                _Exit()
        ElseIf @error = 2 Then ;@error=2表示输入超时
                MsgBox(262144 + 32, "真遗憾!!!", "输入口令时间超时", 9)
                _Exit()
        ElseIf @error = 3 Then ;输入框显示失败,这通常是由参数失效引起
                MsgBox(262144 + 16, "意外错误!!!", "口令输入框显示失败!请重试!", 9)
                _Exit()
        Else
                _Exit()
        EndIf
EndFunc   ;==>_CheckPassWords
;###########严整密码函数结束##############

Func _Exit()
        Exit
EndFunc   ;==>_Exit
发表于 2010-5-6 12:24:47 | 显示全部楼层
回复 7# newuser


    我这测试正常哦
发表于 2010-5-6 13:17:27 | 显示全部楼层
回复 8# afan
难道是因为皮肤的问题吗?可是执行没有错误啊!
请再测试一下!!!
#cs
学习制作皮肤
实践结果:换肤成功

第1步:将SkinCrafterDll.dll和皮肤文件LEDWidget.skf复制到程序所在目录---完成

第2步:在include头文件后插入如下代码:
         FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
         FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
         $Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
                 
第3步:在#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 450, 193, 125)后插入一行代码,注意:保持Form1前后一致
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)

第4步:1.将SkinCrafterDll.dll和皮肤文件LEDWidget.skf复制到程序所在目录
2.在include头文件后插入如下代码:
  FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
   FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
   $Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")
3.在#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 450, 193, 125)后插入一行代码,注意:保持Form1前后一致
_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)
4.在窗口函数代码段后插入如下代码:
  ;定义皮肤函数
Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
        $Dll = DllOpen($SkincrafterDll)
        DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
        DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
        DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
        DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
        DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc   ;==>_SkinGUI

;皮肤退出
Func Quit()
        GUISetState(@SW_HIDE)
        DllCall($Dll, "int:cdecl", "DeInitDecoration")
        DllCall($Dll, "int:cdecl", "RemoveSkin")
        DllClose($Dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll")
        FileDelete(@TempDir & "\LEDWidget.skf")
                Exit
EndFunc 

总结:第3和第4步可根据自己需要进行位置调整,如把皮肤文件变成$Group1的背景,即把第3和第4步的代码加入到$Group1代码后,只不过
      _SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)里的$Form1要变成$Group1了

问题1:我从机器中找到其它的.skf文件重新命名为LEDWidget.skf,执行后怎么有的有效果,有的没有效果?
我的答案:难道是文件自身的问题。

本程序应用功能:
1。加皮肤;
2。加密码验证;
3。加背景音乐;---有问题

#ce

;事件响应版系统工具,不带密码验证

Opt("GUIOnEventMode",1) ;采用事件模式响应
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

FileInstall("SkinCrafterDll.dll", @TempDir & "\SkinCrafterDll.dll", 1)
FileInstall("LEDWidget.skf", @TempDir & "\LEDWidget.skf", 1)
$Dll = DllOpen(@TempDir & "\SkinCrafterDll.dll")


#Region ### START Koda GUI section ### Form=

$Form1 = GUICreate("系统工具集 ", 631, 454, 192, 114)


_SkinGUI(@TempDir & "\SkinCrafterDll.dll", @TempDir & "\LEDWidget.skf", $Form1)

Func _SkinGUI($SkincrafterDll, $SkincrafterSkin, $Handle)
        $Dll = DllOpen($SkincrafterDll)
        DllCall($Dll, "int:cdecl", "InitLicenKeys", "wstr", "1", "wstr", "", "wstr", "1@1.com", "wstr", "1")
        DllCall($Dll, "int:cdecl", "InitDecoration", "int", 1)
        DllCall($Dll, "int:cdecl", "LoadSkinFromFile", "wstr", $SkincrafterSkin)
        DllCall($Dll, "int:cdecl", "DecorateAs", "int", $Handle, "int", 25)
        DllCall($Dll, "int:cdecl", "ApplySkin")
EndFunc   ;==>_SkinGUI

;皮肤退出
Func Quit()
        GUISetState(@SW_HIDE)
        DllCall($Dll, "int:cdecl", "DeInitDecoration")
        DllCall($Dll, "int:cdecl", "RemoveSkin")
        DllClose($Dll)
        FileDelete(@TempDir & "\SkinCrafterDll.dll")
        FileDelete(@TempDir & "\LEDWidget.skf")
                Exit
EndFunc 


$Group1 = GUICtrlCreateGroup(".exe类", 48, 32, 169, 305)
$Button2 = GUICtrlCreateButton("Windows更新程序", 64, 56, 137, 33)
$Button3 = GUICtrlCreateButton("远程桌面", 64, 96, 137, 33)
$Button4 = GUICtrlCreateButton("系统信息", 64, 136, 137, 33)
$Button5 = GUICtrlCreateButton("文件签名验证程序", 64, 176, 137, 33)
$Button6 = GUICtrlCreateButton("任务管理器", 64, 216, 137, 33)
$Button7 = GUICtrlCreateButton("系统配置实用程序", 64, 256, 137, 33)
$Button8 = GUICtrlCreateButton("磁盘垃圾清理", 64, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group2 = GUICtrlCreateGroup(".msc类", 232, 32, 169, 305)
$Button9 = GUICtrlCreateButton("本地服务设置", 248, 56, 137, 33)
$Button10 = GUICtrlCreateButton("共享文件夹管理器", 248, 96, 137, 33)
$Button11 = GUICtrlCreateButton("磁盘碎片整理", 248, 136, 137, 33)
$Button12 = GUICtrlCreateButton("计算机管理", 248, 176, 137, 33)
$Button13 = GUICtrlCreateButton("磁盘管理", 248, 216, 137, 33)
$Button14 = GUICtrlCreateButton("本地安全设置", 248, 256, 137, 33)
$Button15 = GUICtrlCreateButton("设备管理器", 248, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup(".cpl类(控制面板)", 416, 32, 169, 305)
$Button16 = GUICtrlCreateButton("系统属性", 432, 56, 137, 33)
$Button17 = GUICtrlCreateButton("用户帐户", 432, 96, 137, 33)
$Button18 = GUICtrlCreateButton("自动更新", 432, 136, 137, 33)
$Button19 = GUICtrlCreateButton("网络连接", 432, 176, 137, 33)
$Button20 = GUICtrlCreateButton("区域和语言选项", 432, 216, 137, 33)
$Button21 = GUICtrlCreateButton("添加/删除程序", 432, 256, 137, 33)
$Button22 = GUICtrlCreateButton("Internet属性", 432, 296, 137, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("以上工具也可通过运行执行", 48, 352, 537, 65)
$Input1 = GUICtrlCreateInput("", 64, 376, 337, 21)
$Button1 = GUICtrlCreateButton("运行", 416, 368, 105, 33)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Label1 = GUICtrlCreateLabel("感谢hynq2000!仅为练手使用---采十青青橄榄  2010.4.27", 216, 424, 320, 66)
$Group5 = GUICtrlCreateGroup("", 32, 20, 569, 455)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

SoundPlay("Mus_24.mid", 0)

;###########进行事件关联##############
GUISetOnEvent($gui_event_close,"_Exit") ;错误:将  $ 写成 @
GUICtrlSetOnEvent($Button2,"_SysTools") ;点击$Button2,函数_SysTools响应,注意,不需要书写_SysTools(),而且要用" "将函数括起来
GUICtrlSetOnEvent($Button3,"_SysTools") ;另外注意是GUICtrlSetOnEvent(),不是GUISetOnEvent(),人家可是控件啊 !
GUICtrlSetOnEvent($Button4,"_SysTools")
GUICtrlSetOnEvent($Button5,"_SysTools")
GUICtrlSetOnEvent($Button6,"_SysTools")
GUICtrlSetOnEvent($Button7,"_SysTools")
GUICtrlSetOnEvent($Button8,"_SysTools")
GUICtrlSetOnEvent($Button9,"_SysTools")
GUICtrlSetOnEvent($Button10,"_SysTools")
GUICtrlSetOnEvent($Button11,"_SysTools")
GUICtrlSetOnEvent($Button12,"_SysTools")
GUICtrlSetOnEvent($Button13,"_SysTools")
GUICtrlSetOnEvent($Button14,"_SysTools")
GUICtrlSetOnEvent($Button15,"_SysTools")
GUICtrlSetOnEvent($Button16,"_SysTools")
GUICtrlSetOnEvent($Button17,"_SysTools")
GUICtrlSetOnEvent($Button18,"_SysTools")
GUICtrlSetOnEvent($Button19,"_SysTools")
GUICtrlSetOnEvent($Button20,"_SysTools")
GUICtrlSetOnEvent($Button21,"_SysTools")
GUICtrlSetOnEvent($Button22,"_SysTools")
GUICtrlSetOnEvent($Button1,"_SysTools")
;###########事件关联完毕##############

;###########进入##############
;注意:没有这个循环,界面是一闪而过
While 1
        Sleep(1)
WEnd
;###########主循环完毕##############

;###########定义响应事件的函数##############
Func _SysTools()
        Switch @GUI_CtrlId ;这是事件模式,别忘了消息模式是 Switch @GUIGetMsg()
                Case $Button2 ;开始执行系统的exe文件,一般它们都在  \system32目录下
                        Run(@SystemDir&"\wupdmgr.exe") 
                Case $Button3
                        Run(@SystemDir&"\mstsc.exe")
                Case $Button4
                        Run(@SystemDir&"\winmsd.exe")
                Case $Button5
                        Run(@SystemDir&"\sigverif.exe")
                Case $Button6
                        Run(@SystemDir&"\taskmgr.exe")
                Case $Button7
                        Run(@WindowsDir&"\pchealth\helpctr\binaries\Msconfig.exe") ;msconfig命令不在\system32目录下
                        ;Run(@SystemDir&"\tsshutdn.exe") 它是60秒倒计时关机命令
                Case $Button8
                        Run(@SystemDir&"\cleanmgr.exe")
                Case $Button9 ;开始执行系统的msc文件,一般它们都在  \system32目录下,通过shellexecute执行它们
                        ShellExecute(@SystemDir&"\services.msc")
                Case $Button10
                        ShellExecute(@SystemDir&"\fsmgmt.msc")
                Case $Button11
                        ShellExecute(@SystemDir&"\dfrg.msc")
                Case $Button12
                    ShellExecute(@SystemDir&"\compmgmt.msc")
                Case $Button13
                        ShellExecute(@SystemDir&"\diskmgmt.msc")
                Case $Button14
                        ShellExecute(@SystemDir&"\secpol.msc")
                Case $Button15
                        ShellExecute(@SystemDir&"\devmgmt.msc")
                Case $Button16 ;开始执行系统的cpl文件,一般它们都在  \system32目录下,通过control来执行.cpl文件
                        Run("control sysdm.cpl")
                Case $Button17
                        Run("control userpasswords2")
                        ;Run("control nusrmgr.cpl"),不知道为什么它不好使!
                Case $Button18
                        Run("control wuaucpl.cpl")
                Case $Button19
                        Run("control ncpa.cpl")
                Case $Button20
                        Run("control intl.cpl")
                Case $Button21
                        Run("control appwiz.cpl")
                Case $Button22
                        Run("control inetcpl.cpl")
                Case $Button1 ;执行 “运行” 按钮
                        Run('cmd /c'&GUICtrlRead($input1)) ;刚开始,$Button1就是没有反映,原来是忘记将其进行事件关联了
                        ;RunWait(@ComSpec&" /c "&GUICtrlRead($Input1)) ;参数  /c 表示要执行后面的“命令字符串”,而字符串是来自控件$input1内的内容
                        ;问题2:输入 msconfig 怎么不执行呢?
                        ;答:笨蛋!它不在/system32目录下,必须输入绝对路径才能执行,要不然再修改Path把msconfig所在的目录也加上
                        ;问题3:如何执行tasklist后让出现的窗口定住呢?Run('cmd /c pause')只是又打开一个DOS的暂停窗口啊?
                        ;答:其实在$input1内输入“tasklist & pause"就实现了,不过这还是DOS啊!
                        ;cmd /V:ON  启用“延迟变量”的意思!
        EndSwitch
EndFunc

Func _Exit()
        Exit
EndFunc
发表于 2010-5-6 13:22:32 | 显示全部楼层
回复 9# newuser


    也没问题,不过测试时没有加载皮肤(没有相关文件)
发表于 2010-5-6 13:47:31 | 显示全部楼层
回复 10# afan
谢谢老大,羞愧万分!因为是打开了多个AU3文件进行代码拷贝剪贴对比操作,竟然有一个与其他路径都不同,而这个恰恰是我做测试用的,导致无法找到MID路径,唉!
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-6-3 10:03 , Processed in 0.081433 second(s), 21 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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