Board index » delphi » WIN32 equivalent of WIN 3.1 's DriveComboBox, Directory/File ListBoxes

WIN32 equivalent of WIN 3.1 's DriveComboBox, Directory/File ListBoxes

Hi,
I need the Drive and directory combo and a file box equivalent to those
in the open, save as etc dialogues.  What I'm after is making a save-as
(or very similar) dialogue, but with icelandic captions, labels etc., but
I can't translate the dialogues..
Help please,
Kristin
 

Re:WIN32 equivalent of WIN 3.1 's DriveComboBox, Directory/File ListBoxes


I could be mistaken, but I don't think they exists. Perhpas a 3rd party has
developed them.

Try Delphi Super Pages. I don't know the exact url, but go to
http://developers.href.com and click *Search the Delphi Super Page*.

Good luck

Ronan van Riet

Quote
Kristn Agnarsdttir wrote in message ...
>Hi,
>I need the Drive and directory combo and a file box equivalent to those
>in the open, save as etc dialogues.  What I'm after is making a save-as
>(or very similar) dialogue, but with icelandic captions, labels etc., but
>I can't translate the dialogues..
>Help please,
>Kristin

Re:WIN32 equivalent of WIN 3.1 's DriveComboBox, Directory/File ListBoxes


Quote
> I need the Drive and directory combo and a file box equivalent to those
> in the open, save as etc dialogues.  What I'm after is making a save-as
> (or very similar) dialogue, but with icelandic captions, labels etc., but
> I can't translate the dialogues..

Kristin,

perhaps the Shell Control Pack at http://www.plasmatech.com/shellctl.htm
can be of help. There is also shelltree at
http://members.tripod.com/~JPStotz/TShellTree.html.

A "modernized" TDriveCombobox was published by Dave Jewell in issue 40 (Dec 98) of The
Delphi Magazine (see http://www.itecuk.com/delmag).

There are methods to directly modify a common dialog, by the way, at least if you use
Delphi 3 or 4. TOpenDialog et al. have an OnShow event which fires just before the dialog
becomes visible and also a Handle property (not listed in the D3 help) which can be used to
figure out the window handle for the dialog. API functions can be used to find controls and
change their captions. This OnShow handler would change the caption of the OK button in a
TSaveDialog, for example:

var
  buffer: array [0..80] of char;]
begin
  StrCopy( Buffer, 'Create New' );
  SendMessage( GetParent((Sender as TSaveDialog).handle),
CDM_SETCONTROLTEXT, IDOK, integer(@Buffer));
end;

The CommDlg Unit defines the custom messages that can be used with common dialogs. To
figure out the control ids to use one has to either examine the dialog templates inside
comdlg32.dll with a resource editor or use code like this in a testbed application:

Function enumchildproc( ctrl: HWND; list: TStrings ): Bool; stdcall;
Var
  buf: Array [0..80] of Char;
  id : Integer;
  caption: array [0..80] of Char;
Begin
  result := True;
  getClassname( ctrl, buf, 80 );
  id := getdlgCtrlid( ctrl );
  getwindowtext( ctrl, caption, 80 );
  list.add( format('Class: <%s>, id: <%d>, caption: <%s>',
                   [buf, id, caption] ));
End;

procedure TForm1.SaveDialog1Show(Sender: TObject);
begin
  memo1.lines.clear;
  memo1.wordwrap := false;
  EnumChildWindows( Windows.GetParent( Savedialog1.handle ),
                    @enumchildproc,
                    longint(memo1.lines ));
end;

The result on my (german) system is this:

Class: <Static>, id: <1091>, caption: <Speichern &in:>
Class: <ComboBox>, id: <1137>, caption: <>
Class: <Static>, id: <1088>, caption: <>
Class: <ListBox>, id: <1120>, caption: <>
Class: <Static>, id: <1090>, caption: <Datei&name:>
Class: <Edit>, id: <1152>, caption: <>    
Class: <Static>, id: <1089>, caption: <Datei&typ:>
Class: <ComboBox>, id: <1136>, caption: <>
Class: <Button>, id: <1040>, caption: <Mit Sch&reibschutz ?ffnen>
Class: <Button>, id: <1>, caption: <&Speichern>
Class: <Button>, id: <2>, caption: <Abbrechen>
Class: <Button>, id: <1038>, caption: <&Hilfe>
Class: <ToolbarWindow32>, id: <1>, caption: <>
Class: <#32770>, id: <0>, caption: <>

You will see a number of controls in the list that are hidden. The control
IDs should not change between invocations of the dialog, there is a remote
change that they may change with different versions of the common dialogs
DLL.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitely requested!

Other Threads