Bill Walton
Bill Walton

Reputation: 823

Getting display device output type with DirectX

I need to find out, in code (C++ on Windows 7), whether my video card is using vga, dvi or hdmi output, but from looking through the DirectX documentation I haven't found a way to do this. Using GetAdapterDisplayMode() http://msdn.microsoft.com/en-us/library/bb174316%28v=VS.85%29.aspx I can get the screen size and refresh rate and 'Format' in a D3DDISPLAYMODE structure http://msdn.microsoft.com/en-us/library/bb172548%28v=vs.85%29.aspx but I'm not sure what the 'Format' represents, or whether it's relevant.

Thanks.

Upvotes: 0

Views: 1861

Answers (1)

CarlJohnson
CarlJohnson

Reputation: 541

The Windows Management Interface provides some information on attached monitors.

See here for a C++ example on how to query the WMI.

To check the monitor connection type, use the namespace "root\\wmi" and query "Select * from WmiMonitorConnectionParams". The VideoOutputTechnology column of the result is one of D3DKMDT_VIDEO_OUTPUT_TECHNOLOGY.

Upvotes: 2

Related Questions