dannyres Posted September 24, 2003 Posted September 24, 2003 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 Quote
dannyres Posted September 24, 2003 Author Posted September 24, 2003 Ok ive found out i need to use auxSet/GetVolume, and theres some example code on allapi.net... could someone help me to convert it to vb.net, or any .net language.... the page is here: http://www.mentalis.org/apilist/auxSetVolume.shtml Thanks... Dan Quote
*Gurus* Derek Stone Posted September 24, 2003 *Gurus* Posted September 24, 2003 Declare Function auxSetVolume Lib "winmm.dll" Alias "auxSetVolume" ( _ ByVal uDeviceID As Integer, _ ByVal dwVolume As Integer) As Integer Quote Posting Guidelines
dannyres Posted September 24, 2003 Author Posted September 24, 2003 (edited) 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: 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.. 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 Edited September 24, 2003 by dannyres Quote
*Gurus* Derek Stone Posted September 26, 2003 *Gurus* Posted September 26, 2003 You'll need to define mutiple overloads of RtlMoveMemory in many cases. Most of your other API related questions are answered in VB.NET: Platform Invoke. Quote Posting Guidelines
Recommended Posts