Hello everybody,

I need to know your opinions of this: usually the SendTo folder has shortcuts that can be executed when you right click an object in the explorer window. Shortcuts are a lot of trouble and though I downloaded Donkey's example I still don't understand them so I just copied my executable to the SendTo folder and it now appears on the SendTo menu. Is anything wrong with doing this? or is there some reason I don't know about that restricts the SendTo folder to shortcuts only?

best regards,

czDrillard
Posted on 2004-06-14 00:32:25 by czDrillard
Hi czDrillard,

Was there a problem with the shortcut library I posted ? It was originally written for GoAsm and so there may be a problem with MASM I am unaware of but it should work fine with it. I you would like I can do a special function to add a shortcut to the SendTo folder, it isn't a problem at all.
Posted on 2004-06-14 00:41:27 by donkey
Donkey, there was no problem with the shortcut lib. the problem is maybe with me. I'm not sure how to use this library. In particular I'm interested in the MakeLink proc. I should be able to substitute the path for the SendTo directory in it and build the program. I haven't tried this yet as I thought copying my exe to the SendTo folder looked simpler. But I will try it and let you know how I make out.

best regards and thanks for your reply,

czDrillard
Posted on 2004-06-14 08:27:02 by czDrillard
There shouldn't be anything wrong with copying your EXE to the sendto folder, at least not as long as you copy it to the per-user folder (same goes for shortcuts though, I believe). It just feels somewhat "dirty" to do this rather than creating a link :)
Posted on 2004-06-14 09:08:42 by f0dder
Hi,

If you look at this thread

http://masmforum.com/viewtopic.php?t=3144

I posted a "work in progress" files library in the GoAsm forum, it has a more complete set of link functions including ...

CreateSpecialFolderLink:

This is a wrapper function for CreateLink that creates a link in a special folder
It works the same as CreateLink except that the path is not supplied with lpLinkName
Parameters:
lpLinkTarget = Pointer to the fully qualified path of the link target
lpLinkName = Pointer to a name for the link file
lpDescription = A description to add to the link, can be NULL
csidl = The class ID of the special folder
see the following url for a list of possible values :
[url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp[/url]
The first icon in the file is used for the link icon
The extension .LNK is added to lpLinkName automatically
If lpDescription is NULL, no description will be added
CoInitialize must be called at some point in your program before this function
Returns 0 if successful


This library has been tested under GoAsm only, though it should work fine with MASM. Source is included in the zip so if you have to you can translate it easily.
Posted on 2004-06-14 09:11:34 by donkey
I'm still trying to build the sample asm files but get missing filename everytime. If I can't get this thing working I'm going to have to play in the dirt like f0dder says :)

best regards,

czDrillard
Posted on 2004-06-15 08:36:41 by czDrillard
Mmmm,

I still do not see the difficulty here. I have attached a demonstration of creating a link in the sendto folder that works here just fine. It is exactly the same as the one to create a desktop one but with the CLSID changed. I also added one undocumented function (ILFree) to free the id list returned by SHGetSpecialFolderLocation.

The demo just uses the GetOpenFileName dialog, you select any file and it will create a link in the SendTo folder of the current user.

I had a little time so I tested the demo under Win95, Win98SE, Win2K and WinNT4 and it worked perfectly in all cases. I checked the link by double clicking it and the link was always good. I don't have ME or XP so I can't check those
Posted on 2004-06-15 12:42:42 by donkey
Works perfectly here, donkey - WinXP SP1a, running with admin privileges. As expected, it creates the shortcut correctly, for the current user.
Posted on 2004-06-15 13:43:58 by f0dder
Thanks donkey, I can't find much documentation on this subject, at least documentation that I can understand so I appreciate your help. Got everything working great now other than the description.

I changed invoke MakeSendToLink,offset FilePath,offset FileTitle,NULL to invoke MakeSendToLink,offset FilePath,offset FileTitle, ADDR szDescription where szDescription is the name I want to show up in the SendTo menu. It compiled and ran properly but the name stayed the same. Have you got any suggestions on this?

best regards,

czDrillard
Posted on 2004-06-15 23:21:23 by czDrillard
The description is the description of the file that pops up when you hover the mouse over it in XP or in the quicklaunch bar, to change the name of the link file just put whatever you want it to be called in place of FileTitle
Posted on 2004-06-15 23:30:41 by donkey
Using shortcuts in the SendTo folder is mainly a matter of program file management. Seeing that Windows offer 6 ways to do things. The executable should be centrally located in Program Files. Then using shortcuts to give access in different spot around Windows. Desktop, SendTo, StartMenu, etc.

So you have only one spot to update the executable.

Regards, P1 :cool:
Posted on 2004-06-16 22:42:37 by Pone