Unit LFNdlg

This component uses Win95 constants to add long file name capability to the standard CommDlg.DLL file entry dialogs. It allows retrieval of either a filename or a directory name. It uses 2 custom dialog resources in the file OpenLFN.res and overrides the Execute (and DoExecute) methods of TOpenDialog/TSaveDialog. The custom dialogs are not very custom; in particular they use the same controls and identifier constants as the dialogs in COMMDLG.DLL as they were sucked out using Borland Resource Workshop. The dialog for WantDirectory simply has the file editbox, listbox and filetype combo set to NOTVISIBLE in the resource. A little trick of placing a tilde as the filename before opening the editbox allows it to close without selecting a file. The tilde is then removed and FileName contains the path. This is something I did way back in BC++/OWL 2 with some success. Caveats when getting a directory name-- 1. you must use the OK button to close the dialog; 2. A directory cannot be selected unless its folder is open. IOW, clicking the OK button on a "closed" dir folder with subfolders opens the folder but does not select the folder and close the dialog. You must select it again then click OK. If you fix this, send me an update! Code by Thomas Bigler on the CompuServe Delphi forum originally showed me that it was possible to have my cake and eat it too, i.e. to have a single component that worked in Win3.1 normally and in Win95 with long file names. Thanks Thomas! His code is in a file called LFNopen.zip. I'm afraid I borrowed liberally from Borland Delphi 2's DoExecute method in Dialogs.pas although I did make a contribution which loads the correct dialog template from the resource file. It works in both Win3.1 and Win95 because COMMDLG.DLL in both environments is (apparently) 16 bit and only needs an extra flag to access the long file names. This flag is specified in the dialog resource. This code is given to the public domain freely to use as you wish. Just don't expect any support. Naturally, by using this code you assume all responsibility for anything that happens when you use it. Brian Lowe 01August 1997 Beond Technology Corp. Internet: brianlow@mcs.com Compuserve: brianlow For some awesome Delphi graphics components, see THotButton, TImageFX and TStretchPanel at http://www.mcs.net/~brianlow/

Classes

TLongOpenDialog -
TLongSaveDialog -

Functions

Register -

Types

Constants

Variables


Functions


procedure Register;


Types


Constants


Variables