.NET & Volume Control.

dannyres

Well-known member
Joined
Aug 29, 2003
Messages
67
Hey guys, does anyone know the API and how to use it, to control the system wide (main) volume? I know how todo this in vb6, but ive tried to convert it with no luck.... any help would be appreciate.



Dan


btw, i use vb.net
 
Code:
Declare Function auxSetVolume Lib "winmm.dll" Alias "auxSetVolume" ( _
    ByVal uDeviceID As Integer, _
    ByVal dwVolume As Integer) As Integer
 
ok, so in .net i need to convert all Longs to integers?.. (sorry im new to .net) anyway ive managed to convert most of the code in that example on AllApi.net except this:

Code:
Private Type AUXCAPS
       wMid As Integer
       wPid As Integer
       vDriverVersion As Integer
       szPname As String * MAXPNAMELEN
       wTechnology As Integer
       dwSupport As Integer
End Type
Private Type VolumeSetting
    LeftVol As Integer
    RightVol As Integer
End Type

....could someone please help :)



Dan


EDIT: oh and also As Any, which seems to have been removed in .net..

Code:
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (ByVal hpvDest As Any, ByVal hpvSource As Any, ByVal cbCopy As Integer)


I have a strange feeling this isnt going to work even when i have converted it :P
 
Last edited by a moderator:
Back
Top