?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
Caption = "音量控制"
ClientHeight = 2340
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 2340
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command7
Caption = "恢復原始音量"
Height = 495
Left = 360
TabIndex = 6
Top = 1440
Width = 3735
End
Begin VB.CommandButton Command6
Caption = "6"
Height = 615
Left = 3360
TabIndex = 5
Top = 600
Width = 615
End
Begin VB.CommandButton Command5
Caption = "5"
Height = 615
Left = 2760
TabIndex = 4
Top = 600
Width = 615
End
Begin VB.CommandButton Command4
Caption = "4"
Height = 615
Left = 2160
TabIndex = 3
Top = 600
Width = 615
End
Begin VB.CommandButton Command3
Caption = "3"
Height = 615
Left = 1560
TabIndex = 2
Top = 600
Width = 615
End
Begin VB.CommandButton Command2
Caption = "2"
Height = 615
Left = 960
TabIndex = 1
Top = 600
Width = 615
End
Begin VB.CommandButton Command1
Caption = "1"
Height = 615
Left = 360
TabIndex = 0
Top = 600
Width = 615
End
Begin VB.Label Label1
Caption = "音量控制"
Height = 375
Left = 360
TabIndex = 7
Top = 120
Width = 2055
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, lpdwVolume As Long) As Long
Private Declare Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long
Dim savvol
Private Sub Command1_Click()
i = waveOutSetVolume(0, 0)
End Sub
Private Sub Command2_Click()
i = waveOutSetVolume(0, 600000000)
End Sub
Private Sub Command3_Click()
i = waveOutSetVolume(0, 1100000000)
End Sub
Private Sub Command4_Click()
i = waveOutSetVolume(0, -1400000000)
End Sub
Private Sub Command5_Click()
i = waveOutSetVolume(0, -600000000)
End Sub
Private Sub Command6_Click()
i = waveOutSetVolume(0, -1)
End Sub
Private Sub Command7_Click()
'恢復原始音量
i = waveOutSetVolume(0, savvol)
End
End Sub
Private Sub Form_Load()
Me.Show
'保存當前音量
i = waveOutGetVolume(0, savvol)
k = App.Path + "\test.wav"
l = &H1 Or &H2
i = sndPlaySound(k, l)
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -