当前位置:编程学习 > VB >>

控制系统音量

 

         

Attribute VB_Name = "MIXER"

****************************************************************************

* This constant holds the value of the Highest Custom volume setting. The *

* lowest value will always be zero. *

****************************************************************************

Public Const HIGHEST_VOLUME_SETTING = 12

 

Put these into a module

device ID for aux device mapper

Public Const AUX_MAPPER = -1&

Public Const MAXPNAMELEN = 32

 

Type AUXCAPS

wMid As Integer

wPid As Integer

vDriverVersion As Long

szPname As String * MAXPNAMELEN

wTechnology As Integer

dwSupport As Long

End Type

 

flags for wTechnology field in AUXCAPS structure

Public Const AUXCAPS_CDAUDIO = 1 audio from internal CD-ROM drive

Public Const AUXCAPS_AUXIN = 2 audio from auxiliary input jacks

 

flags for dwSupport field in AUXCAPS structure

Public Const AUXCAPS_VOLUME = &H1 supports volume control

Public Const AUXCAPS_LRVOLUME = &H2 separate left-right volume control

 

Declare Function auxGetNumDevs Lib "winmm.dll" () As Long

Declare Function auxGetDevCaps Lib "winmm.dll" Alias "auxGetDevCapsA" (ByVal uDeviceID As Long, lpCaps As AUXCAPS, ByVal uSize As Long) As Long

 

Declare Function auxSetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal dwVolume As Long) As Long

Declare Function auxGetVolume Lib "winmm.dll" (ByVal uDeviceID As Long, ByRef lpdwVolume As Long) As Long

Declare Function auxOutMessage Lib "winmm.dll" (ByVal uDeviceID As Long, ByVal msg As Long, ByVal dw1 As Long, ByVal dw2 As Long) As Long

 

****************************************************************************

* Possible Return values from auxGetVolume, auxSetVolume *

****************************************************************************

Public Const MMSYSERR_NOERROR = 0

Public Const MMSYSERR_BASE = 0

Public Const MMSYSERR_BADDEVICEID = (MMSYSERR_BASE + 2)

 

****************************************************************************

* Use the CopyMemory function from the Windows API *

****************************************************************************

Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (hpvDest As Any, hpvSource As Any, ByVal cbCopy As Long)

 

****************************************************************************

* Use this structure to break the Long into two Integers *

补充:软件开发 , Vb ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,