How do I call the "Open file dialog box" api in VB6

All (well almost) program under Win95-98 uses the same openfile dialogbox API
how do I call this API with VB6
Who is Participating?
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
Do you really want to use API commands or you accept an easier substitute?

Here what I have to proposed (and you will have the standard dialog box). In fact, it is an OCX that calls those APIs.

Add the Microsoft Common Dialog Control to your project, place an instance on a form, also place a command button on this form and paste this code:
Private Sub Command1_Click()
    MsgBox CommonDialog1.FileName
End Sub

You cannot have a simplest solution.
LazypeteAuthor Commented:
If u need info about my question... fell free to ask

emoreau's answer is far better than using any API calls. Use the common dialog control - and look at the help because there is an awful lot you can do with it to make it work exactly the way you want it to - especially look into how it can deal with long filenames and so on.
LazypeteAuthor Commented:
Exactly what I wanted..
Thanx a lot..
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.