Open File Dialog Hacking Questions [Win32, C++]

Started by
2 comments, last by jwezorek 13 years, 4 months ago
Hello I have a few questions about the Open file dialog you can make in Win32. My first question is: Is it possible to speed up loading? It seems like it takes 3-4 seconds to appear when I call it.

My second question is, is it possible to chance the background color of the file list area in the Open File dialog? I seen some hacks done to a few of them, such as adding check boxes or changing the layout or will I simply have to make my own open file dialog to do this?

Thanks for reading, ajm113.
Check out my open source code projects/libraries! My Homepage You may learn something.
Advertisement
Quote:Original post by ajm113
Hello I have a few questions about the Open file dialog you can make in Win32. My first question is: Is it possible to speed up loading? It seems like it takes 3-4 seconds to appear when I call it.


It can be slow the first time an app opens the OpenFile dialog, because lots of stuff is going on: a bunch of DLL's are getting loaded, etc. However, if you're seriously seeing 4 seconds in a Release build something might be wrong and/or causing the slowness.

Quote:
My second question is, is it possible to chance the background color of the file list area in the Open File dialog? I seen some hacks done to a few of them, such as adding check boxes or changing the layout or will I simply have to make my own open file dialog to do this?


There is no easy way to customize the common dialog boxes beyond what you can do when filling in the structures that define them, e.g. OPENFILENAME; however, there are non-easy ways to do some customization.

You can, for example, do win32 subclassing on the Open File dialog. This however turns out not to be as helpful as one would think, because what you really want to subclass are the child controls. The other thing to do is to install a WH_CALLWNDPROC hook when the dialog is on the screen and poll for the dialog and its children in your hook procedure (some guy talks about doing this here, although it's poorly written).

If all you want to do is change the background color of one of the child controls, you might be able to do this just by subclassing the relevant control. This kind of thing usually turns out to be brittle and will cause problems down the line, however.
Quote:Original post by jwezorek
Quote:Original post by ajm113
My second question is, is it possible to chance the background color of the file list area in the Open File dialog? I seen some hacks done to a few of them, such as adding check boxes or changing the layout or will I simply have to make my own open file dialog to do this?


There is no easy way to customize the common dialog boxes beyond what you can do when filling in the structures that define them, e.g. OPENFILENAME;


Indeed, there is no easy way to change the background colour. Except perhaps if you read the bit that tells you how to do it (Fifth paragraph of the remarks)
Quote:Original post by adeyblue
Quote:Original post by jwezorek
Quote:Original post by ajm113
My second question is, is it possible to chance the background color of the file list area in the Open File dialog? I seen some hacks done to a few of them, such as adding check boxes or changing the layout or will I simply have to make my own open file dialog to do this?


There is no easy way to customize the common dialog boxes beyond what you can do when filling in the structures that define them, e.g. OPENFILENAME;


Indeed, there is no easy way to change the background colour. Except perhaps if you read the bit that tells you how to do it (Fifth paragraph of the remarks)


Huh, didn't know about that stuff ... However, wouldn't that just let you change the background color of the dialog itself, not the ListView as the OP seems to want.

This topic is closed to new replies.

Advertisement