Max Destiny
asked on
Hey Audio!
Hey I'm trying to change the value of my Audio volume but I can find Audio in System.Windows.Input;
ASKER
ok thank you!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hmm I have this:
using System;
using System.Collections.Generic ;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServ ices;
namespace WindowsFormsApplication143
{
public partial class Form1 : Form
{
public const int VolumeHandler = 0x319;
public const int VolumeUp = 0xA0000;
public const int VolumeDown = 0x90000;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
[DllImport("newuser36.dll" )]
public static extern IntPtr RealtekHighDefinitionAudio (IntPtr WPARAM, IntPtr NMAPAR, int Msg,IntPtr VolumeHandler);
private void VolumeUpMain()
{
RealtekHighDefinitionAudio (this.Hand le, this.Handle, VolumeUp, (IntPtr)VolumeHandler);
}
private void VolumeDownMain()
{
RealtekHighDefinitionAudio (this.Hand le, this.Handle, VolumeDown, (IntPtr)VolumeHandler);
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode==Keys.A)
{
VolumeUpMain();
}
if (e.KeyCode == Keys.B)
{
VolumeDownMain();
}
}
}
}
and it says that it cannot find the device(HResult:0x8007007E)
using System;
using System.Collections.Generic
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Runtime.InteropServ
namespace WindowsFormsApplication143
{
public partial class Form1 : Form
{
public const int VolumeHandler = 0x319;
public const int VolumeUp = 0xA0000;
public const int VolumeDown = 0x90000;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
[DllImport("newuser36.dll"
public static extern IntPtr RealtekHighDefinitionAudio
private void VolumeUpMain()
{
RealtekHighDefinitionAudio
}
private void VolumeDownMain()
{
RealtekHighDefinitionAudio
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if(e.KeyCode==Keys.A)
{
VolumeUpMain();
}
if (e.KeyCode == Keys.B)
{
VolumeDownMain();
}
}
}
}
and it says that it cannot find the device(HResult:0x8007007E)
Is this a new Audio Device you installed? If yes did it install without issues?
ASKER
yes no issues
It seems that this sounds like a hardware issue. Have you also checked the manufacturers web site to see if there are any API calls that differs from Windows standards for the volume increase and decrease commands?
ASKER
hmmm no:)
Well then if the hardware installed correctly and the hardware does not use their own API's to control volume and use the standard Microsoft API's and it is still not working then I am at a lost and do not know what else to have you do.
Open in new window