Click to See Complete Forum and Search --> : How to set detail view when FileOpen dialog begins
Tom Gettys
05-14-2001, 04:56 PM
In Microsoft Visual C++,when using the FileOpen common dialog:
CFileDialog dlg(TRUE, ...)
the default view is list.
I would very much like to know how to override this behavior so that the
file list populates as a details view. Since there is a button on the dialog
that allows the user to select details view it would *seem* that this is
easy, but I have been unable to discover a reasonable way to do it.
Boris Karadjov
05-15-2001, 03:47 PM
Using Class Wizard add a class derived from CFileDialog, for example
CFileDetailsDialog.
In CFileDetailsDialog override virtual void OnInitDone():
void CFileDetailsDialog::OnInitDone()
{
GetParent()->PostMessage(WM_COMMAND, MAKEWPARAM(0xA004, 0));
CFileDialog::OnInitDone();
}
This works fine on Windows NT 4, but since the command 0xA004 is not defined
in any header file, it is possible that the code will fail with other
Windows versions.
Boris Karadjov
Brainbench MVP for Visual C++
http://www.brainbench.com
"Tom Gettys" <tpgettys@teleport.com> wrote in message
news:3b004668$1@news.devx.com...
>
> In Microsoft Visual C++,when using the FileOpen common dialog:
> CFileDialog dlg(TRUE, ...)
> the default view is list.
>
> I would very much like to know how to override this behavior so that the
> file list populates as a details view. Since there is a button on the
dialog
> that allows the user to select details view it would *seem* that this is
> easy, but I have been unable to discover a reasonable way to do it.
devx.com
Copyright WebMediaBrands Inc. All Rights Reserved