Toggle monitor HDR mode with DXGI API - windows

Microsoft documentation and sample code claims that DXGI can switch a monitor between HDR/SDR modes. However running the code sample D3D12HDR and changing the swap chain format does not change the monitor mode for me.
I am only able to set the screen into hdr either through:
windows display settings, "Play HDR games and apps" toggle switch
nvidia api functions
Is it possible to change the monitor's HDR mode using only DXGI API?
My monitor is an ASUS XG27U.

There are no DX APIs to set the display into HDR mode. It must be enabled in Windows display settings.
Use of the NVIDIA API functions is discouraged.

Related

Screenshot of window with hardware accelerated rendering

I'm trying to get a screenshot of windows using PrintWindow. Windows using hardware rendering are not captured. For example Chrome, Edge. In Windows 7 they are captured, but in Windows 10, 11 they are no longer there. There is a suspicion that this is due to the version of WDDM. Is there any possibility:
capture hardware rendering?
disable hardware rendering for the whole system?
Disable or otherwise affect WDDM?
I 've made a simple capture library here. Code is here and it's based on Desktop Duplication API. Microsoft sample is here. It uses hardware capturing.
My work primarily captures video with sound, but there is a frame callback you can use to capture a frame. Apparently it's the same API that is used to capture games etc.

How can I change audio output device default share mode sample rate in Windows 7?

I am using windows audio core api to do loopback-capture, and failed on this:
// spClient is a smart comptr wrapped IAudioClient
hr = spClient->Initialize(AUDCLNT_SHAREMODE_SHARED, AUDCLNT_STREAMFLAGS_LOOPBACK,iRequestedDuration, 0, &m_struWaveFormat, 0);
It returns AUDCLNT_E_UNSUPPORTED_FORMAT, because m_struWaveFormat is 44100,16bit format, but the configure in device property page is 48000,24bit format in share mode. If I changed this to 44100, 16 bit format, the codes aboved runs well. So, anybody can tell me how to change default share mode sample rate using audio core api please?
Thanks & Regards
You can't change the shared mode sample rate using WASAPI.
WASAPI is very low level and supports only what the underlying device supports. But even if the device supports your desired sample rate, only the administrator can change the shared mode sample rate by going into audio settings in the Control Panel.
You may however want to take a look at the Windows Registry to see if there's anything you can tweak (assuming you're running with admin privileges). Stuff in the Control Panel is often just a front end to values in the Windows Registry.

How to get Pressure from a Tablet PC to be used with HTML5-Canvas

I want to draw with my Tablet PC (HP Elitebook) in a web page, and I want to create a "Paint" that I can use in a web browser, using HTML5-Canvas if possible.
I'm new to Tablet PC programming ... and I only found ways to manage stylus pressure with a Microsoft library or QT ... but it is not for webpages.
I also found that there is something for Wacom tablets ( http://www.wacomeng.com/web/index.html ) but it doesn't seems to work with my Tablet PC.
So how can I manage Tablet inputs in a website (and especialy get pressure) ?
And also, what are the most commun and well documented library (in C/C++/Java) for managing a Tablet PC ?
If you use the firefox 4 or later, you can get pressure value from DOM MouseEvent's "mozPressure" property.
Please see also:
http://dougturner.wordpress.com/2008/12/10/mouse-pressure-support-in-mozilla/
https://developer.mozilla.org/en/DOM/MouseEvent
I believe the stylus, which contains the pressure sensor, is made by Watcom in that unit. They would need to write a custom plugin to offer browser support for their device. Send them a mail!

Programmatically set the audio device being "listened" to in Windows

In Windows 7 you can go in to audio devices and check "Listen to this device", so the audio signal is played through speakers. Is there a way to set this, perhaps some variable in the Win32 API, so it can be changed without going in to the settings dialog?
Not all audio devices on Windows support this option in the control panel. But there's some docs on loopback recording on MSDN.
http://msdn.microsoft.com/en-us/library/dd316551%28VS.85%29.aspx

Windows Phone 7 Volume Settings programmatically

Is there a way to programmatically change the sound settings of Windows Phone 7? Enable or disable sounds for Appointment and all other notifications? Also to change the global volume i.e.:Ring tone.
There is no API to enable the tasks that you've mentioned. You can adjust the sound volume for the sounds within an application by using the XNA API's, but that is the extent of the control that is currently available.
You can control the volume of the media player and of a sound affect, but you don't have control over the master volume. Also note there is a bug in the sound drivers on some HTC devices that causes them to ignore the volume setting on sound affects.

Resources