Select file in a windows explorer box

I am making a program in which the user needs to select a file. I have seen a lots of programs that has a browse button, and a windows explorer window appears. It will be used to select a file, and return the file path as a string. How can i do this?
Use the Common Dialog API. For your reference:

http://msdn.microsoft.com/en-us/library/windows/desktop/bb776913%28v=vs.85%29.aspx

The code example on that page shows how to show the Open dialog and get the results.
Most simple way is tio just use legacy GetOpenFileName() API:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms646927(v=vs.85).aspx
Thanks!
Topic archived. No new replies allowed.