PDA

View Full Version : WinXP programming question


VunderBob
11-17-2009, 11:36 AM
I did RTFM, and could not find anything to do what I want.

Is there a set of WIN32 programming functions that would create a file shortcut?

I'm working on a configuration utility to run at boot time, and I need to put some non-existant shortcuts into the system startup folder. THis is supposed to work automagically, so manual creation (the only way I know to do it right now) is not an option. I looked through the file functions and saw nothing; looking for explicit shortcut routines turned nothing up, either.

Once the shortcuts exist, I have a good grasp on how to use the file functions to get them where they need to be.

Gus Gusterson
11-17-2009, 12:01 PM
Look for CreateLink in the Shell API.

Gus Gusterson
11-17-2009, 12:06 PM
It just occurred to me that CreateLink isn't actually a function in the API. I'm just so used to calling it that I started thinking of it as being part of the API.

Here's an example from CodeGuru that should get you started: http://www.codeguru.com/cpp/w-p/files/shellapifunctions/article.php/c7209/

CaveMike
11-17-2009, 12:36 PM
Gus has the correct answer. But you might find the example here (http://msdn.microsoft.com/en-us/library/bb776891(VS.85).aspx) easier to use since it is not tied to the dialog.

VunderBob
11-18-2009, 12:32 PM
Gus has the correct answer. But you might find the example here (http://msdn.microsoft.com/en-us/library/bb776891(VS.85).aspx) easier to use since it is not tied to the dialog.

Cave, I actually used code from your example over Gus', because your's wasn't tied to a dialog box (simplicity). It took a little twiddling but I got it to create a shortcut to Sol.Exe, and placed it in the startup directory like I wanted. Now I have to edit my program to change all the innocuous and experimental manipulations to the ones I really need to make happen.

I'm satisfied it works, and a big thank you to both of you for helping me out.