April 30, 2024, 01:14:17 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Folders and Files

Started by Brian, April 02, 2024, 08:33:50 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Brian

Considering what I am doing with my GDI Picture Viewer, in that I am using an external DLL (pbsctrl.dll) to show drives, folders and files, does anyone have the code to do the same thing using Windows API?

There does seem to be some drawbacks in using this DLL, one being the loss of file icons (icon memory running out?), and it not always showing folders properly, ie, hanging up at times

Brian

Egil

April 02, 2024, 10:24:13 AM #1 Last Edit: April 02, 2024, 10:26:30 AM by Egil
I don't have IWB on this laptop, but I think I have a similar snippet for IWB or EB at home.
But here is the code for CreativeBasic. Should be easy to convert to IWB


Good Luck!
Egil
Support Amateur Radio  -  Have a ham  for dinner!

Brian

Good effort, Egil! But what I really want is for drives and folders to be in their own Treeview control. Anyway, here's your code converted to IWB, if anyone is interested

Brian

Egil

April 03, 2024, 12:47:04 PM #3 Last Edit: April 03, 2024, 01:12:33 PM by Egil
Horst Schaeffer have written a smart little tool doing exactly that. I beleive it is written with PureBasic. The program is called "MemPad", and can be found on hiw webpage:
https://www.horstmuc.de/win.htm

If I was going to write such a tool, I would first call the FolderFind routine above, and then inspect the returned buffer line by line.
If the specific returned line is a file, write it to the first branch of a TreeView and if it is a folder put the returned buffer on hold and call the FolderFind routine again using a buffer with a second name and do the same with this new buffer until the end is reached, and then continue with the first buffer again.

In this way you will be able to fill in rather complex TreeViews. And I really beleive that the author of MemPad has done the coding in a similar way.

Should be interresting to try something like this, but that has to wait till I'm back home again ( in seven weeks). Or maybe you can try a day you become extra inspired??


Regards from Trondheim.

Egil
Support Amateur Radio  -  Have a ham  for dinner!

Brian

Found some Powerbasic code to have a play with later
Brian

ckoehn

There is this example in the IWBASIC Example folder.

Later,
Clint


Brian

Yes, I have seen that, Clint, thanks. What I was hoping for is to get the results of the SHBrowseForFolder into a Treeview without actually showing the BrowseForFolder dialog

Brian