Newbie
Newbie

Reputation: 1613

how to make "choose file" function on windows programming?

I need this us all known "choose file" feature in my program, so i can load files.

What is this thing called as and where is the code for it?

Upvotes: 2

Views: 10225

Answers (3)

Paul Dixon
Paul Dixon

Reputation: 300845

What you are referring to are the "common dialogs", and you can get a file open dialog with GetOpenFileName

BOOL GetOpenFileName(      
    LPOPENFILENAME lpofn
);

A sample is available here

Upvotes: 5

Håvard S
Håvard S

Reputation: 23876

I'm assuming you want to know about the built-in Windows dialog for choosing/opening a file.

If you're doing managed code, see OpenFileDialog.

If you're doing MFC, see CFileDialog.

Upvotes: 1

Eli Bendersky
Eli Bendersky

Reputation: 273476

With plain Win32 API you need to use the GetOpenFileName function, documented here. An example of its usage is available here.

Upvotes: 2

Related Questions