找回密码
 加入
搜索
查看: 1738|回复: 1

[系统综合] API高手进来帮忙解答下,先感谢

[复制链接]
发表于 2014-3-25 17:19:08 | 显示全部楼层 |阅读模式
本帖最后由 jiashuang 于 2014-3-25 17:21 编辑

下图是Windows Media Player的声卡选择界面
用AU3可以实现吗?如果可以,代码应该怎么写?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?加入

×
 楼主| 发表于 2014-3-25 17:53:44 | 显示全部楼层
贴上代码吧        可能更容易理解
#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
$Form1 = GUICreate("Form1", 640, 480)
$Input1 = GUICtrlCreateInput(@WindowsDir & "\media\tada.wav", 20, 20, 300, 20)
$Button1 = GUICtrlCreateButton("选择MP3文件", 340, 20, 100, 20)
$Button2 = GUICtrlCreateButton("开始播放", 460, 20, 60, 20)
$Button3 = GUICtrlCreateButton("停止播放", 540, 20, 60, 20)
$Label1 = GUICtrlCreateLabel("声卡选择", 20, 60, 100, 20)
$Combo1 = GUICtrlCreateCombo("", 100, 60, 400, 20, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL))
GUISetState(@SW_SHOW)

While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        $File=FileOpenDialog("选择MP3文件", "", "MP3文件(*.mp3)")
                        If @error Then
                        MsgBox(4096,"","没有选择文件!")
                        Else
                        GUICtrlSetData($Input1,$File)
                        EndIf
                Case $Button2
                        SoundPlay(GUICtrlRead($Input1))
                Case $Button3
                        SoundPlay("")
        EndSwitch
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

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

GMT+8, 2024-5-15 03:37 , Processed in 0.082581 second(s), 24 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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