I would like to programatically control the volume of a particular application in WinXP.
I came to know abt one API waveOutSetVolume(), but it controls the application volume in Win Vista & Above, for XP it just affect the entire system volume.
Please advise how can we achieve this in XP?
Moreover how to Uncheck/Check the SYstem volume Mute check box as well.
As you said, application-level audio levels are available from Vista OS, so XP has no ability to control it.
More info here: http://msdn.microsoft.com/en-us/library/bb945061.aspx
Your second question related to mute, you simply call waveOutSetVolume:
http://msdn.microsoft.com/en-us/library/windows/desktop/dd743874%28v=vs.85%29.aspx
Related
Windows 8.1 -- the full version, not RT -- automatically boots to the desktop when run from a desktop computer and to the Start screen when run from a tablet. (This functionality may require Update 1; I'm not sure.)
What information does Windows 8.1 use to make this decision, and can I access it programmatically from C++? I have an application that includes a driver that does not (currently) work properly on tablets, so I would like to use this information to warn the user at install time.
It looks like GetSystemMetrics(SM_TABLETPC) is sufficient for my needs, but the WMI query in the comments above is certainly useful if more granular information is needed.
I have a little problem with my virtual disk device in Windows Explorer.
After sending IOCTL_VCRYD_MOUNT_VOLUME to device driver, I want it to show up in explorer. My device successfully mounts (if I kill explorer.exe process in Task Manager and then run it again, I'm able to see my device in drives list), but i can't see it in Windows Explorer (if I don't perform an operation described above).
I haven't found anything appropriate in Kernel Mode, so I tried to use SHChangeNotify(SHCNE_DRIVEADD, SHCNF_PATH, mydrivestring, NULL); with mydrivestring in different formats in User Mode application. But this doesn't help.
So how can i notify Windows Explorer about new disk drive added?
You can make this by calling WinAPI BroadcastSystemMessage function
But if someone can tell me how to use SHChangeNotify, I'd be grateful.
Under Windows (7,8) I can mute / adjust volume as per application and per output device.
I wonder how I can set / query these values from my C++ Qt application. Basically I need to figure out / accomplish (use cases):
Is the global mute set (per device)? Set global mute from my application.
Is the application's mixer mute set? Set mixer mute.
Set mixer volume, set global volume.
Query mixer volume, set mixer volume?
Wherever possible I am looking for the Qt-ish way to accomplish things, keeping code as platform independent as possible. I can imagine to query the global mute via an OS-independent API, but using a Windows only class for the mixer.
From the C# question Get Master Sound Volume in c# I understand IAudioMeterInformation, IMMDeviceCollection, IMMDevice are the MSDN documentation entry points for Windows specific handling.
How do I tell if the master volume is muted? shows how commands can be send via WM_APPCOMMAND . Again, windows specific, also not allowing to query values but only to set them.
Is there something for Qt encapsulating these things? Is it Phonon I need to use? Checking Phonon briefly I did not see any methods for what I need, but I might have missed it.
I'm working on a small C++ project which involves a launcher application that does a bit of setup work and then invokes the real application. To be precise, I'm working on the launcher application - the real application is done by a separate team. These programs are both deployed to Windows Mobile devices. Now, I'd like to be able to get notified of all keyboard and mouse activity in the real application (which my launcher starts) - and I cannot modify the real application to do this.
On Windows desktop machines I'd do this using the SetWindowsHookEx API. However, this is unavailable on Windows Mobile.
I also considered subclassing all windows in the process so that I can handle the relevant window messages for keyboard and mouse input - but I don't know how to get notified of new windows which the real process creates.
Does anybody have some thoughts on how to achieve this?
You can use SetWindowsHookEx, it is only undocumented. This is a good post about hooks and subclassing on Windows Mobile.
Is there a method for controlling the Balance of the Wave output that will work on both XP and Vista?
Vista has a new api for everything related to mixers and audio, per process legacy api's should still work, but to change global volume, you would have to look at the new COM interfaces added to Vista
This should get you started
have you looked at this?
waveOutSetVolume
The waveOutSetVolume function sets the
volume level of the specified
waveform-audio output device.
It uses Winmm.lib.
http://msdn.microsoft.com/en-us/library/ms713762.aspx