Read file properties of video files in C++

I want to figure out what Windows does when you right-click a video file and check properties and I would like to write a similar piece of code in C++.
I should be able to figure out how to read the file type and size, but I'm lost in how to get details of the video like resolution and runtime.
Which API commands does Windows use there?