Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Common Dialog format 2

Status
Not open for further replies.

N1GHTEYES

Technical User
Jun 18, 2004
771
GB
This is one which has puzzled me for a while: lets see if the forum resident geniuses (genii?) can sort it...

When I call the CDLG it opens in List mode with the files sorted by name. Is there any way in code by which i can force it to open in Detail mode and/or sorted by size (or in any other mode e.g. Thumbnails, or by any other column, e.g. date)?

What would be especially nice is to capture the mode a user asserts when using the CDLG, then open it next time using his choice.

Tony
 
I think one way (and maybe the only, though I'm fully open to correction here! [smile]) would be to use the GetOpenFileName API call and then hook the dialog. I don't have a code example to hand but that might help point you somewhere that does?

As for saving the preferences, use the same methods you would normally, be it a config file, a DB, the registry, whatever method works for you really. You should have no problem getting the value back in from them to use with the dialog code.

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I tell a lie, after a bit of googling I've found a working example here

Hope this helps

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Thanks HQ. That looks like it could be very handy.
 
Glad I could help, thanks for the star [smile]

HarleyQuinn
---------------------------------
The most overlooked advantage to owning a computer is that if they foul up there's no law against wacking them around a little. - Joe Martin

Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
I vaguely remembered answering this question before, and after some searching I found it here.

thread222-1063344

It uses the same idea of hooking the dialog box outlined by HarleyQuinn, as used in the above referenced code.
 
Thanks Hypetia, you too deserve a star.

It looks a little more straightforward than the other reference, I'll give it a try.

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top