Ragesh Chakkadath
Ragesh Chakkadath

Reputation: 1531

Display XP Style CFileDialog in Windows 7

I want to display CFileDialog like the image below in Windows 7.

desired dialog

As per msdn

if OFN_ENABLETEMPLATE is set and OFN_EXPLORER flag is not set, the system uses the template to create an old-style dialog box that replaces the default dialog box.

But even after doing that what I get is something like this. The one I get

Please help!

Upvotes: 5

Views: 2005

Answers (2)

Ajay
Ajay

Reputation: 18411

Try this:

CFileDialog fd(1,0,0,0,0,0,0,FALSE);
fd.m_ofn.lStructSize = sizeof(OPENFILENAME_NT4);
fd.DoModal();

The last parameter to CTOR specifies Vista-style to be false, and structure size of sizeofed with to reflect NT4 file-dialog.

Upvotes: 3

cprogrammer
cprogrammer

Reputation: 5665

I don't think you can. That windows belong to OS and is not implemented anymore. The the closest thing you can use is the old-style dialog box.

You can try to customize this one by hooking the window but it's not easy and I don't thing it worth.

Upvotes: 0

Related Questions