I'm writing a small system info program right now (I'll release it here when it's done) and for that I wanted to write a function that returns the DirectX version number as a string. Sounds pretty easy but it actually isn't (if you know otherwise, let me know).
After looking around for some time I found an example program that came with the DirectX 9 SDK which basically tried two different methods to obtain the version number. The first method is to create an interface to DXDiag and obtain the version number from there, the second method is to check the version numbers of the DirectX DLL files.
Long story short, I began by translating the DXDiag C header file to Delphi, then I translated the sample program from the DirectX SDK and then I rewrote it to make it look more like Delphi and less like C.
So if you need to check the DirectX version number, you can download the header and example program here. Of course it's open source so do with it whatever you like. If you're having problems, please let me know.