Board index » cppbuilder » Save Dialog Box - Change how files are displayed

Save Dialog Box - Change how files are displayed

Your post was canceled due to the attachment.  Attachments are only allowed in
the borland.public.attachments group.  Thank you for your future cooperation.

Post fully quoted below without the attachment.

Quote
Softech wrote:

> Hi, I have a problem with my Save Dialog Box,

> right now--just like most save dialog box, the files in a folder are
> displayed as "Small Icons" view (attachment SaveDialog1).

> I have to actually click on the "View Menu icon" on the top of the dialog
> box to change to Details view if I want to have all the files in the folder
> displayed as "Details" View (attachment SaveDialog2 and SaveDialog3) so I
> can see when all those files are modified.

> My question is that is there anything I can change in the registry or the
> properties of the Save Dialog Box to make the "Details" view as default.

> Honestly, I don't think there are any properties there I can change for this
> purpose, so, anything on the registry? or any other ways?

> Thanks

> SL

>  [Image]

>  [Image]

>  [Image]

--
Jeff Overcash (TeamB)   I don't think there are any Russians
(Please do not email    And there ain't no Yanks
 me directly unless     Just corporate criminals
 asked.  Thank You)     Playing with tanks.  (Michael Been)
 

Re:Save Dialog Box - Change how files are displayed


Quote
> Your post was canceled due to the attachment.  Attachments are only
allowed in
> the borland.public.attachments group.  Thank you for your future
cooperation.

> Post fully quoted below without the attachment.

> Softech wrote:

> > Hi, I have a problem with my Save Dialog Box,

> > right now--just like most save dialog box, the files in a folder
are
> > displayed as "Small Icons" view (attachment SaveDialog1).

> > I have to actually click on the "View Menu icon" on the top of the
dialog
> > box to change to Details view if I want to have all the files in

the folder

I agree that there's no registry solution.  I don't have Win2K, but I
notice that the OpenDialog has been revamped there, and it has more
options.  Here's some code that works, although it's not very elegant.
I've left in the collection of the button index and its' info
structure, in the hope you'll find a more robust solution.  I just
don't know enough about ToolBarButtons to "push" one in straight code.
Please post any improvement you make.

in header:

Quote
};

BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam);
HWND hWndToolbar = NULL;
int reportviewbutton=-1;
struct _TBBUTTON vsr;
// --------

in .cpp (note that I did not derive from TOpenDialog.)

/ ---------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
 : TForm(Owner)
{
OpenDialog1->Execute();

Application->Terminate();

Quote
}

// -------------------------------------

void __fastcall TForm1::OpenDialog1Show(TObject *Sender)
{
// The toolbar does not have a dialog control id, so it
// has to be searched for

static int onceonly=false;

if(!onceonly)
 {
   EnumChildWindows(GetParent(((TOpenDialog*)Sender)->Handle),
    (WNDENUMPROC)EnumChildProc, (LPARAM) NULL);
   }

Quote
}

// ----------------------------------------------
BOOL CALLBACK EnumChildProc(HWND hWnd, LPARAM lParam)
{
char classname[100];
int n,i;
struct _TBBUTTON tbb;

GetClassName(hWnd, classname, 100);

if(strcmp(strlwr(classname), "toolbarwindow32") == 0)
 {
   hWndToolbar = hWnd;
   n=::SendMessage(hWndToolbar,TB_BUTTONCOUNT,0,0);
   for(i=0;i<n;i++)
    {
  ::SendMessage(hWndToolbar,TB_GETBUTTON,i,
        (LPARAM)&tbb);
  if(tbb.idCommand==0xA004)  // The id may be useful?
        {
        reportviewbutton=i;
           vsr=tbb;
           }
       }
 }
  return TRUE;

Quote
}

void __fastcall TForm1::OpenDialog1SelectionChange(TObject *Sender)
{
// This task can't be done in OnShow, but a SelChange occurs when
// the dialog box first appears to the user.

static onceonly=false;

if(hWndToolbar && (reportviewbutton>-1) & !onceonly)
 {
 onceonly=true;
 ::SendMessage(hWndToolbar,WM_LBUTTONDOWN,(WPARAM)NULL,
    (LPARAM)MAKELONG(135,12));
 ::SendMessage(hWndToolbar,WM_LBUTTONUP,(WPARAM)NULL,
    (LPARAM) MAKELONG(135,12));
 }

Quote
}

// -----------------------------------------

--
Timothy H. Buchman
========================================
City Center Theater New York NY
tbuchmanPLEASE(at sign)REMOVEcitycenter.org
Please treat this signature information as confidential.
========================================
Search .borland newsgroup archives at:
http://www.mers.com/searchsite.html

Other Threads