Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.pascal.delphi.misc > #707

Re: Open dialog to display directory only (D4)

From "Peter Below (TeamB)" <none@address.invalid>
Newsgroups comp.lang.pascal.delphi.misc
Subject Re: Open dialog to display directory only (D4)
Date 2015-07-21 17:38 +0000
Organization solani.org
Message-ID <xn0joskww1e1e1001@news.solani.org> (permalink)
References <mojobd$umt$1@dont-email.me>

Show all headers | View raw


P E Schoen wrote:

> Hopefully there are still people reading this newsgroup...
> 
> I am working on a new Delphi project called DupZapper which intends
> to open a directory which contains many duplicate files (in this
> case, email), and then find the duplicates and move them to a
> separate ZAP directory. I can hard code the email directory and then
> use the Open Dialog to select all the files in the folder I want to
> ZAP, and perhaps that is easiest and best. But I would like to know
> how to navigate to the directory in case I want to use this
> application on a different computer or for a different user. My email
> directory is:
> 
> C:\Users\paul_000\AppData\Local\Microsoft\Windows Live Mail\Peschoen
> (paul)
> 
> It would be easy enough to store this file location in a text file
> for the application so it can be edited, or perhaps it is available
> in the registry. I don't do much with Delphi lately and I'm rather
> rusty, and want to maintain at least a modicum of familiarity and
> competence.

If you use a TOpenDialog component you can set its InitialDir property
the directory you want the dialog to open in. The Options property
allows you to configure the behaviour of the dialog, e.g. whether it
should allow the user to select more than one file. You call the
dialog's Execute method to show it, and once it is up the user can
navigate around the file system at will. If the directory you specified
at design-time does not exist on the target machine the dialog will
open at a defaul location. Of course you can also set InitialDir at
runtime, e.g. to the folder the user last visited and which you
remembered in a settings file.

-- 
Peter Below (TeamB)

Back to comp.lang.pascal.delphi.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Open dialog to display directory only (D4) "P E Schoen" <paul@pstech-inc.com> - 2015-07-20 17:15 -0400
  Re: Open dialog to display directory only (D4) "Peter Below (TeamB)" <none@address.invalid> - 2015-07-21 17:38 +0000
    Re: Open dialog to display directory only (D4) "Faxe" <Faxe@invalid.invalid> - 2015-07-21 18:12 +0000
      Re: Open dialog to display directory only (D4) "P E Schoen" <paul@pstech-inc.com> - 2015-07-25 23:59 -0400
  Re: Open dialog to display directory only (D4) Richard <nospam@localhost.nil> - 2015-07-22 19:19 +0200

csiph-web