The Straight Dope

Go Back   Straight Dope Message Board > Main > General Questions

Reply
 
Thread Tools Display Modes
  #1  
Old 11-17-2009, 11:36 AM
VunderBob VunderBob is offline
Mostly harmless
Charter Member
 
Join Date: Oct 2002
Location: The VunderLair
Posts: 13,226
WinXP programming question

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.
Reply With Quote
Advertisements  
  #2  
Old 11-17-2009, 12:01 PM
Gus Gusterson Gus Gusterson is online now
Guest
 
Join Date: Oct 2006
Look for CreateLink in the Shell API.
Reply With Quote
  #3  
Old 11-17-2009, 12:06 PM
Gus Gusterson Gus Gusterson is online now
Guest
 
Join Date: Oct 2006
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/file...cle.php/c7209/
Reply With Quote
  #4  
Old 11-17-2009, 12:36 PM
CaveMike CaveMike is offline
Guest
 
Join Date: Oct 2001
Gus has the correct answer. But you might find the example here easier to use since it is not tied to the dialog.
Reply With Quote
  #5  
Old 11-18-2009, 12:32 PM
VunderBob VunderBob is offline
Mostly harmless
Charter Member
 
Join Date: Oct 2002
Location: The VunderLair
Posts: 13,226
Quote:
Originally Posted by CaveMike View Post
Gus has the correct answer. But you might find the example here 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.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:29 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

Send questions for Cecil Adams to: cecil@chicagoreader.com

Send comments about this website to: webmaster@straightdope.com

Terms of Use / Privacy Policy

Advertise on the Straight Dope!
(Your direct line to thousands of the smartest, hippest people on the planet, plus a few total dipsticks.)

Publishers - interested in subscribing to the Straight Dope?
Write to: sdsubscriptions@chicagoreader.com.

Copyright © 2013 Sun-Times Media, LLC.