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!

Windows Explorer - Browse

Status
Not open for further replies.

itflash

Programmer
Jul 18, 2001
535
GB


Hi all

My application needs to have the ability to browse file/folders (local/network files/dirs) in a windows explorer style on a form. I need two of these on a form and need to move files between them.

Have played with various things, including treeview and windows web browser control.

Also thread184-675990 was very useful for understanding the drag-drop.

Whats the best way. I like the web browser control but when I double click a folder, it opens that folder in a new window instead of changing dir in my form.

Any ideas/suggestions?


Many thanks
ITflash




 
There's a function called GETFILE() that allows users to browse and select a file. It doesn't have a treeview of the directory structure on the left the way Windows Explorer does, but it might satisfy your needs.


-BP (Barbara Peisch)
 
itflash said:
I need two of these on a form
As well as Barbara's suggestion, you could consider the Windows Common dialog and/or instance(s) of Windows Explorer launched through the WinAPI call ShellExecute().


Neither would be on a VFP form, but both can be initialised in folders of your choice, support drag 'n drop between themselves and your VFP form, and you can retain the last folder visited by using the JUSTPATH() function to retrieve the path\filename from any files dropped onto your VFP form.

faq184-3106 How can I select multiple files from Windows

may be helpful.

FAQ184-2483 - answering getting answered.​
Chris [pc2]
PDFcommander[sup]tm[/sup].com
PDFcommander[sup]tm[/sup].co.uk


 


Thanks for the replies.

Have used some of the commands before and your FAQ Chris is a good example. I may have to revert to it.

But I would still like to see if it is possible to have two windows type explorer or file browsers in the VFP form and drag/drop between them.

It is a user issue and would help more for moving files around.

The shell.explorer.2 is nice, it just does not navigate properly or I am missing something.

Any ideas anyone?

Thanks
ITflash



 

[morning]
Monday morning.....any fresh ideas anyone?


Thanks
ITflash



 
Itflash,

You can create your own Windows Explorer with the help of two ActiveX controls: the TreeView and the ListView. You will have to do quite a lot of work to mimic all the functionality of Explorer, but it is perfectly possible.

I have done something similar with customer data. Instead of files and folders, the users see customers and order data, but the principle is the same.

If you'd like some of my code, you can grab a copy of my SimpleList control, which will make the right-hand side of the Explorer window much easier. See:

I am working on a similar control for the treeview.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
Thanks for the reply.

Have done some simple things with the Treeview for specific directories, but did not want to re-invent the wheel if there was another way of doing it.

Seems odd that there is no easier way or an activex from MS.

Thanks for the lib. Will be useful for accompying my treeview.

The windows web browser control is so close.......[bugeyed]

ITflash
[thumbsup2]

 
What about using faq184-4092 (Running the web-browser in a VFP form), except navigate to a folder/show folders?

Brian
 

Thanks for the reply.

Tried that, but when you double click a folder, it opens in a new window. Thats the issue I could not resolve.

Tried using navigate2 events, etc, but could not trap the open folder event to try and code my own.

There must be a way......


ITflash

 
That's a browser options setting. I'm sure you could change it for your windows... just not sure exactly how... take a look at some IE automation threads/faqs.

Brian
 
If you want to use Explorer, still wont be on a vfp form, there is a program called twofer, it opens up two instances of explorer at once. You can ever specify the default folder it opens. Just a thought.
 
itflash


How about faq184-3096 "How to use the Outline Control Activex to show a directory"


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
itflash,

I think this might be what you are looking for. Run the Solution example.

Solution -> Foundation Classes -> Create a Visual Foxpro Web browser.

-- AirCon --
 
Thanks all for the replies. [thumbsup2]

Baltman
That's a browser options setting. I'm sure you could change it for your windows... just not sure exactly how... take a look at some IE automation threads/faqs.

Couldnt find a thing, I had a good look around but there was nothing.


Powerprinting
If you want to use Explorer, still wont be on a vfp form, there is a program called twofer, it opens up two instances of explorer at once. You can ever specify the default folder it opens. Just a thought.

- Unfortunately, I do need it on a form.


AirCon
I think this might be what you are looking for. Run the Solution example.
Solution -> Foundation Classes -> Create a Visual Foxpro Web browser.

Problem is, I could not find a way of stopping a new window opening when a user opens a directory.



ITflash


 
ITFlash,

Problem is, I could not find a way of stopping a new window opening when a user opens a directory
As Baltman said, the problem is from IE options settings. Because in my machine (IE 5.5) it doesn't open/launch a new window when I open/double click a new folder.


-- AirCon --
 

Aircon

Thanks for the reply.

Does this work for browsing local directories?

When I try it, it opens a new window but all my settings are set to not open a new window.

Even when I run the solution example and browse the local C drive, it always opens a folder in a new window.

My windows explorer settings are to open in the same window.
I am on Windows 2000 and using IE 6.

I'm interested that yours stays in the same window.

Thanks
ITflash

 
Yes it works for browsing local directories. I tried with C, D then navigate (double click) thru subfolder, it stays on the same form!

Perhaps you could ask about this setting in W2K forum

Hope you can work it out

-- AirCon --
 
That's a browser options setting.

It's actually an Explorer setting, not Internet Explorer.
Fire up Explorer (Windows key + E or 'My Computer'), then go to 'Tools->Folder Options'.
Look at the 'Browse Folders' option group.

Now to do that for every user would be a registry setting somewhere, but I'm not sure where.
Then again, it goes against the grain to change user settings.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 

Thanks for the reply


Tried that - it's already set to that.


ITflash

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top