LITTLEBLACKDOG.COM Forum Index LITTLEBLACKDOG.COM

 
LWD LWD   FAQ FAQ   Memberlist Memberlist   Usergroups Usergroups   Active Topics Active Topics   Register Register  
  Profile Profile   Log in to check your private messages Log in to check your private messages   Log in Log in  
  Who is Online Who is Online   Image Gallery Image Gallery   Chat Chat   Search Search  
  LWDGear       LBDGear  

View next topic
View previous topic
Post new topic     Reply to topic   LITTLEBLACKDOG.COM Forum Index » Code Warriors
Author Message
Alphi
Big Dog
Big Dog


Joined: 05 Apr 2002
Age: 37
Posts: 3035
Location: Grand Rapids, MI USA

Post Posted: Thu May 01, 2008 11:08 am   Post subject: Windows Explorer Context Menu additions Reply with quote Back to top  

Hey guys,

I need your help, actually with two mostly-separate things.


1) I need to find a way to add an entry to the context menu in Windows Explorer so that when the user selects a file or folder, it has a new option for "Import". Once the user selects that menu item, it needs to call a custom-built EXE (written in VB.NET 2005), passing the selected file/folder path as an arg.

Here's the good news - I found an easy way to do it, but it works just for folders. If I add, in the registry, an entry under HKEY_CLASSES_ROOT/Folder/Shell an entry called "Import", and under that an entry called "command", and set the default of that entry to the path to my EXE (plus %1 as the end to pass the path), it works for folders.

But I cannot figure out a way to do it for files.


2) If the user selects two folders, or two files, or a file and a folder, I want it to open one instance of my EXE with both paths passed to it. I think the way to do this is to keep it with the one "path" arg, but add code to the module such that if the EXE is already in memory and running, just add the new path to it (probably via a public sub or function) rather than starting up a new instance of the form.

Unfortunately, I can't figure out either how to check if it's already running, nor how to transfer data to the already-running instance of it so that I can add the other items to it.


Also bear in mind that I'm writing this in VB.NET (2005).


Any ideas?

_________________
They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety.
- Benjamin Franklin


Prosper.com - P2P lending
View user's profile Send private message Send e-mail ICQ Number
CMTG
Leg Humper
Leg Humper


Joined: 23 Feb 2002
Posts: 4895
Location: On average, Cheltenham.

Post Posted: Thu May 01, 2008 11:48 am   Post subject: Re: Windows Explorer Context Menu additions Reply with quote Back to top  

Alphi wrote:
Also bear in mind that I'm writing this in VB.NET (2005).


Bearing in mind that you have access to the same APIs as the other .Net languages, including C++, take a look at the source code for TortoiseCVS or TortoiseSVN, which both do exactly what you're looking for.

And if there isn't a native .Net version of the function you want, I know for sure you can also call raw Win32 APIs from VB.net, because I've done it myself. (God knows why the plaform SDK doesn't have full coverage in .Net. Rolling Eyes )

_________________
Pie. I wish I could
constrain my hungry greed but...
Sadly, defeated.


Charlene's Law: There's no such thing as can't.
Charlene's Corollary: Unless it's followed by be arsed.
View user's profile Send private message Send e-mail Visit poster's website
T
Curmudgeon


Joined: 17 May 2001
Posts: 16085
Location: Airstrip One

Post Posted: Fri May 02, 2008 1:26 am   Post subject: Reply with quote Back to top  

http://www.google.co.uk/search?q=contextmenuhandlers

_________________
Got questions? Click here.
Still got questions? Click here, too.

affabletoaster, Akely, anglachel, blahpony, CMTG, EdisonRex, Elk, Equin, evilness, Fido, fathertyme, Goddess, Jaymac, je, jodygirl, KingKobra, Lycander, mally, Max, OhioArt2, perrito_blanco, Rover, Spot, sully_51, Superdwarf, the taz man, thriftyjack, twiztid, wrathiron, yiayia49

A journey of 3,500 miles begins with a single comic.

Would you like
good music at a price that is right? CD Baby, baby.

The best way to blow off steam is to blow off someone's nadgers.
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic     Reply to topic

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
phpBB SEO
All times are GMT - 8 Hours

Help us keep advertisements off this site. Donate today!