PC Review


Reply
Thread Tools Rate Thread

How to control the volume of the CE devic in CSharp

 
 
compboy
Guest
Posts: n/a
 
      31st Dec 2004


 
Reply With Quote
 
 
 
 
Peter Foot [MVP]
Guest
Posts: n/a
 
      31st Dec 2004
You can either P/Invoke the waveOutSetVolume API method, or use the
ready-made OpenNETCF.Multimedia.Audio.Player class and it's Volume property
(www.opennetcf.org/sdf/)

Peter

--
Peter Foot
Windows Embedded MVP
www.inthehand.com | www.opennetcf.org

"compboy" <(E-Mail Removed)> wrote in message
news:u4O$(E-Mail Removed)...
>
>



 
Reply With Quote
 
compboy
Guest
Posts: n/a
 
      31st Dec 2004
Thanks, Peter.
I had tried the first method,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
public class CoreLibVol
{
[DllImport("Coredll.dll")]
public static extern bool sndPlaySound(string lpszSoundName, uint
fuSound);

[DllImport("Coredll.dll")]
public static extern uint waveOutSetVolume(uint hwo, ulong dwVolume);
...
}

public class SetVolumeCls
{
...
public void GetWaveFormAudio()
{
uint DeviceID;
uint pVolume;

CoreLibVol.waveOutGetVolume(DeviceID, out pVolume);
}

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
how can i get the DeviceID in my program?



"Peter Foot [MVP]" <(E-Mail Removed)> 写入消息新闻
:(E-Mail Removed)...
> You can either P/Invoke the waveOutSetVolume API method, or use the
> ready-made OpenNETCF.Multimedia.Audio.Player class and it's Volume

property
> (www.opennetcf.org/sdf/)
>
> Peter
>
> --
> Peter Foot
> Windows Embedded MVP
> www.inthehand.com | www.opennetcf.org
>
> "compboy" <(E-Mail Removed)> wrote in message
> news:u4O$(E-Mail Removed)...
> >
> >

>
>



 
Reply With Quote
 
Paul G. Tobey [eMVP]
Guest
Posts: n/a
 
      31st Dec 2004
Read the source for the OpenNETCF class?

Paul T.

"compboy" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Thanks, Peter.
> I had tried the first method,
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> public class CoreLibVol
> {
> [DllImport("Coredll.dll")]
> public static extern bool sndPlaySound(string lpszSoundName, uint
> fuSound);
>
> [DllImport("Coredll.dll")]
> public static extern uint waveOutSetVolume(uint hwo, ulong dwVolume);
> ...
> }
>
> public class SetVolumeCls
> {
> ...
> public void GetWaveFormAudio()
> {
> uint DeviceID;
> uint pVolume;
>
> CoreLibVol.waveOutGetVolume(DeviceID, out pVolume);
> }
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> how can i get the DeviceID in my program?
>
>
>
> "Peter Foot [MVP]" <(E-Mail Removed)> 写入消息新闻
> :(E-Mail Removed)...
>> You can either P/Invoke the waveOutSetVolume API method, or use the
>> ready-made OpenNETCF.Multimedia.Audio.Player class and it's Volume

> property
>> (www.opennetcf.org/sdf/)
>>
>> Peter
>>
>> --
>> Peter Foot
>> Windows Embedded MVP
>> www.inthehand.com | www.opennetcf.org
>>
>> "compboy" <(E-Mail Removed)> wrote in message
>> news:u4O$(E-Mail Removed)...
>> >
>> >

>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I increase the sound volume in my computer beyond the volume control? bernardofhoppe@yahoo.com Windows XP General 1 14th Sep 2006 10:53 PM
Volume Works in Ctl Panel but can't Display Volume Control in Task =?Utf-8?B?Q3Vic2Zhbg==?= Windows XP Setup 5 17th Jul 2006 02:56 PM
volume control - how can I open the FULL volume control from the first double click ? Cristian Secara Windows XP Music 3 20th Jun 2005 09:15 PM
AP detect mute/unmute, volume up/down from windows volume control =?Utf-8?B?c3RldmU=?= Microsoft C# .NET 0 17th May 2005 09:35 PM
XP home addition - Volume control via Master Volume icon not working =?Utf-8?B?R2F2aW4=?= Windows XP New Users 1 27th Apr 2004 03:07 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:55 AM.