Complicated situation - Opening folders

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
ThatOneGuy
Posts: 77
Joined: Fri Jan 04, 2013 9:57 am

Complicated situation - Opening folders

Post by ThatOneGuy » Sun Jan 06, 2013 8:46 pm

I am wondering if there is a way of either intercepting all explorer directory calls and launching a program sending the directory as a parameter when certain directories containing a specific string in their name are called, or just forcing windows to open these directories with something other than explorer.exe (the latter would be preferable).

In either case, I'd like explorer.exe to not open the folder in question, but it should be opened with my program instead. These directories should be treated almost like files by explorer, but should still be able to be opened with explorer, just not by default. Even if explorer can't open them after this point, it doesn't really matter.

I'd rather not need to drop these folders onto my program's executable every time I want to use them.

What I need to know is:
1. Is this even possible in LiveCode or any programming language (others, like C++, are perfectly fine options, but I'd prefer to use LiveCode)?
2. If it is possible, how can I do this?

Simon
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3901
Joined: Sat Mar 24, 2007 2:54 am

Re: Complicated situation - Opening folders

Post by Simon » Mon Jan 07, 2013 3:14 am

dataTree and rTree
http://www.runrev.com/store/
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!

ThatOneGuy
Posts: 77
Joined: Fri Jan 04, 2013 9:57 am

Re: Complicated situation - Opening folders

Post by ThatOneGuy » Mon Jan 07, 2013 5:16 am

I was hoping for a response that didn't ask me to spend $50 (or more if you are suggesting I need both?) since this is a home-brew application. There is no funding going into this one. Not to mention that this reply doesn't explain anything as to how I can accomplish this task even if I wanted to use these addons.

Looking at Data Tree, That is definitely NOT what I am looking for. If I wanted a file tree, I would just use the one I already built previously and save myself the $50.
rTree looks almost the same as Data Tree, and is also not what I am looking for. An internal file browser will not help me at all since the program will be invisible.

I am trying to launch my application whenever certain folders are called by explorer.exe (as in, whenever the user double-clicks it), preferably intercepting the call so it doesn't open the folder. It would work just like a drag and drop onto my .exe or like any standard "Open with..." command from native Windows. The problem is that this option is not present for folders (no surprise there). My only option currently is the drag-and-drop method, which gets old quickly.

Anything using default LiveCode or any free / Open Source options -- or even better yet, native Windows options -- will be appreciated. I just want non-archived folders to be treated like archived folders by Windows explorer (while still maintaining their structure and contents the whole time) and launched by my program by default.

This will likely be very complicated and I wouldn't be surprised if it isn't possible at all in Windows.

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: Complicated situation - Opening folders

Post by sturgis » Mon Jan 07, 2013 7:07 pm

You might do a google search for "folder actions for windows"

I found quite a few options that might work for what you wish to do. I say might because most of the folder actions seem to be when a new file is added to a folder or that sort of thing. But its a good direction to start looking. Not sure how things work on windows, but I also wonder if an autorun.inf file inside a folder might actually work. (Unless autorun is disabled by the user of course)

If the autorun.inf inside the folder actually executes, you can probably have it kickstart your app (or send a message to your app or whatever)

Not sure what all your requirements are, but maybe this will point you in a helpful direction.

ThatOneGuy
Posts: 77
Joined: Fri Jan 04, 2013 9:57 am

Re: Complicated situation - Opening folders

Post by ThatOneGuy » Tue Jan 08, 2013 4:06 am

Thanks for your attempts at figuring this out for me.

That's an interesting program you are mentioning, Sturgis. I may look into that a bit more later since it's free and would be fun to play around with, but it only allows users to work with stuff dropped into specific folders, not actions done on the folder itself. I am guessing that the program is set to monitor the folders it is assigned to and check for changes. When a change occurs, it will do some preset action to the new file added to the folder. I already know how to monitor folders for things like this and it would be possible to make a similar program from scratch in LiveCode within a few days (or in an afternoon, depending on how simple I were to make it), but it still doesn't offer the ability to check if these monitored folders are opened and would have a terrible time if these folders were ever moved.

I am trying to run something similar to an autorun from within a folder whenever it is called, regardless of where it is called from or who calls it, and send a message to launch my program with the folder in question as a parameter along with the action that needs to be taken. As I said before, I can drop these folders onto my program now and it works just fine since the folder gets sent as a parameter and the proper information is read. I just can't figure out where the call to open folders comes from between the system and explorer.exe or how to track it so that it automatically runs my program without any added effort.

The problem with an autorun.inf file is that it cannot be automatically run from anywhere other than a removable device with static storage. This limits it to pretty much just a CD or similar removable storage. Even external drives are unable to start an autorun file.

It would just be nice if Windows had an option to tag folders with special functions or properties so that they would act the way you want.

Since I don't think this has ever been done before, I am expecting the "It's just not possible" message pretty soon.

Post Reply