Hey guys I was wondering how do I open files like most programs have?

Is there a windows api for that? I would like to open and look for avi files and then the file that is chosen gets its location and filename added to text1?