I want to read the DirectX version from Registry.
I found the value at HKLM\Software\Microsoft\DirectX under the value Version.
My problem: Refering to Hey Scripting Guy! my version "4.09.00.0904" is 9.0c, but dxdiag shows DirectX 11.
How to find the right version? Or is there probably a way to solve this without the registry?
EDIT: I'm using Windows 7 Professional x86
You can't detect any version above DirectX 9 from the registry. It's simply not stored in there.
For versions 10 and above, you should use the COM interface to DXDiag.
dwDirectXVersionMajor
and dwDirectXVersionMajor
(systemInfo->GetProp( ... ))szDirectXVersionLetter
as well.Inconvenient? Very. Write once, wrap in a utility function, never look back. Or copy-paste one of the common implementations.