disk defrag

I am developing a project on hard drives, I want to know if there is an index on windows, or API that can be used, a C ++ code, which can help us to make a decision of the defrag disk.
Could anyone help.
Topic archived. No new replies allowed.