TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Naredla Nithesh
NA
328
78.5k
How to change the System Volume programmatically
Jul 29 2014 4:56 AM
Hai Every one ...I want to change the System volume .I am using fallowing code......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace shaped_form
{
class VolumeChange
{
private const int APPCOMMAND_VOLUME_MUTE = 0x80000;
private const int APPCOMMAND_VOLUME_UP = 0xA0000;
private const int APPCOMMAND_VOLUME_DOWN = 0x90000;
private const int WM_APPCOMMAND = 0x319;
[DllImport("user32.dll")]
public static extern IntPtr SendMessageW(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
private void btnMute_Click(object sender, EventArgs e)
{
SendMessageW(
this.Handle
, WM_APPCOMMAND,
this.Handle
,(IntPtr)APPCOMMAND_VOLUME_MUTE);
}
private void btnDecVol_Click(object sender, EventArgs e)
{
SendMessageW(
this.Handle
, WM_APPCOMMAND,
this.Handle
,(IntPtr)APPCOMMAND_VOLUME_DOWN);
}
private void btnIncVol_Click(object sender, EventArgs e)
{
SendMessageW(
this.Handle
, WM_APPCOMMAND,
this.Handle
,(IntPtr)APPCOMMAND_VOLUME_UP);
}
}
}
But I got an error at the highlighted places...as shown below...i got this code from some internet sources
Reply
Answers (
4
)
clr
DataTable Expression