Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Select a group of files

Status
Not open for further replies.

CEMrob

Programmer
Sep 2, 2008
24
GB
thread184-456868

VFP 9 SP2. Win 7 (Most Users: XP pro)
For some time I've used a method for selecting a group of files using ChrisRChamberlain's approach with _comdlg1 in the above thread, as summarised by Foxegg on 31 Jan 2003 in the same thread. Works great, thanks people.

I've now had a complaint from one user that the dialog box is not sizeable, and can I please make it so. I can't. Is it possible?

Rob
 
Hardly.

In the end the FFC Class used makes use of the Windows API call GetopenFileNameA, which is declared to VFP by:

DECLARE INTEGER GetOpenFileNameA IN comdlg32.dll AS _FFC_GETFILENAME STRING @

But the whole logic wrapped around this is quite complex. If you're willing to drop the usage of the ffc class and start from scratch, there is a flag for that GetOpenFileNameA function, determining if the openfile dialog is sizible or not. It's buried into the dialoghandler() method of the _comdlg class within _system.vcx: OFN_ENABLESIZING.

It won't help you much, as it's not recommendable to make changes to the ffc classes because their recompilation can cause the class to get corrupted via UAC and File Virtualisation mechanisms in Vista and later.

You better make direct usage of that API call or use VistaDialogs4COM, where available:

Code:
LOCAL ARRAY aFiles(1)
m.aFiles(1) = ""
m.oOpenFile = CREATEOBJECT("VistaDialogs4COM.CommonOpenFileDialog")
m.oOpenFile.Title = .text3.value
IF !m.oOpenFile.ShowDialog()
    m.aFiles = m.oOpenFile.FileNames
ENDIF

Unfortunately this won't work for your major users of XP, and I also don't see how you would incorparate the sizable flag here.

Good Luck.

Bye, Olaf.
 
PS: The code snippet is taken from Craig Boyds Blog and not meant for 1:1 usage. It shows the simplicity of retrieving an array of files choosen, though.

Bye, Olaf.
 
Thanks Olaf. You've confirmed what I suspected, that it is not possible, or at least not possible for someone of my limited abilities. I'll just tell my users that, in the words of the song, "you can't always get what you want".
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top