Board index » cppbuilder » Setting View to Thumbnails in TOpenFileDialog

Setting View to Thumbnails in TOpenFileDialog


2005-02-27 01:08:52 AM
cppbuilder93
Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails View?
Also TOpenPictureDialog.
BCB5 and always WinXP.
--
Thanks, Patrick
 
 

Re:Setting View to Thumbnails in TOpenFileDialog

Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails View?
Also with TOpenPictureDialog.
Or Even Better, the last used View for that folder.
BCB5 and always WinXP.
An example would be great.
--
Thanks, Patrick
 

Re:Setting View to Thumbnails in TOpenFileDialog

"Patrick" < XXXX@XXXXX.COM >wrote in message
Quote
Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails View?
Also with TOpenPictureDialog.
Or Even Better, the last used View for that folder.

BCB5 and always WinXP.

An example would be great.
--
Thanks, Patrick
-----------------------------------------
I did find this snipped which works fine for switching between List View and
Details view, but I really want to force a Thumbnails View. Any ideas
anyone?
void __fastcall TForm1::OpenDialog1Show(TObject *Sender){
#define DETAILS_TOOLBUTTON_CMD (0xA004)
#define LIST_TOOLBUTTON_CMD (0xA003)
TOpenDialog * dlg;
HWND parenthandle=NULL;
dlg=dynamic_cast<TOpenDialog *>(Sender);
if(dlg) parenthandle=GetParent(dlg->Handle);
if (parenthandle != NULL )
::PostMessage(parenthandle,WM_COMMAND, DETAILS_TOOLBUTTON_CMD, NULL);
}
Thanks, Patrick
 

{smallsort}

Re:Setting View to Thumbnails in TOpenFileDialog

Hi Patrick,
Try the following code in the OpenDialog's OnFolderChange event
handler...
HWND const hView = FindWindowEx(
GetParent(OpenDialog1->Handle), NULL, "SHELLDLL_DefView", NULL
);
SNDMSG(hView, WM_COMMAND, 28717, 0);
For future reference, the wParam is 28721 for Windows 2000, and 28720
for Windows 98. (I never tested Windows Me.)
HTH,
--
Damon (TeamB)
C++Builder Developer's Journal
bcbjournal.org
Patrick wrote:
Quote
Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails View?
Also with TOpenPictureDialog.
Or Even Better, the last used View for that folder.

BCB5 and always WinXP.

An example would be great.
 

Re:Setting View to Thumbnails in TOpenFileDialog

Worked like a champ. Thanks Damon.
Are there other magic numbers like 28717 for forcing other views?
--
Regards, Patrick
Quote
Hi Patrick,
Try the following code in the OpenDialog's OnFolderChange event
handler...

HWND const hView = FindWindowEx(
GetParent(OpenDialog1->Handle), NULL, "SHELLDLL_DefView", NULL
);
SNDMSG(hView, WM_COMMAND, 28717, 0);

For future reference, the wParam is 28721 for Windows 2000, and 28720 for
Windows 98. (I never tested Windows Me.)

HTH,
--
Damon (TeamB)
C++Builder Developer's Journal
bcbjournal.org


Patrick wrote:
>Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails
>View?
>Also with TOpenPictureDialog.
>Or Even Better, the last used View for that folder.
>
>BCB5 and always WinXP.
>
>An example would be great.
 

Re:Setting View to Thumbnails in TOpenFileDialog

Whoops, I found some magic nums. Not tested but 28717 is 0x702d, and it
works.
enum LISTVIEWCMD
{ ODM_VIEW_ICONS = 0x7029,
ODM_VIEW_LIST = 0x702b,
ODM_VIEW_DETAIL= 0x702c,
ODM_VIEW_THUMBS= 0x702d,
ODM_VIEW_TILES = 0x702e,
};
--
Regards, Patrick
---------------------------------------------------------------------------------------------
Quote
Worked like a champ. Thanks Damon.

Are there other magic numbers like 28717 for forcing other views?
--
Regards, Patrick

>Hi Patrick,
>Try the following code in the OpenDialog's OnFolderChange event
>handler...
>
>HWND const hView = FindWindowEx(
>GetParent(OpenDialog1->Handle), NULL, "SHELLDLL_DefView", NULL
>);
>SNDMSG(hView, WM_COMMAND, 28717, 0);
>
>For future reference, the wParam is 28721 for Windows 2000, and 28720 for
>Windows 98. (I never tested Windows Me.)
>
>HTH,
>--
>Damon (TeamB)
>C++Builder Developer's Journal
>bcbjournal.org
>
>
>Patrick wrote:
>>Is it possible (dangerous?) to Open the OpenFileDialog in Thumbnails
>>View?
>>Also with TOpenPictureDialog.
>>Or Even Better, the last used View for that folder.
>>
>>BCB5 and always WinXP.
>>
>>An example would be great.