WIN32 / How to Create a Desktop Icon?
BlitzMax Forums/BlitzMax Programming/WIN32 / How to Create a Desktop Icon?
| ||
Hi, All the examples I've looked at on the Web use COM to create a desktop shortcut. Does anyone know of any other way to do this? Cheers, Si... |
| ||
This is the best I could find: http://superuser.com/questions/392061/how-to-make-a-shortcut-from-cmd |
| ||
Thanks @PhotonTom So far I have cobbled together the following: Shortcuts.bmx SNIP - See below for bug-fixed version shortcut.c SNIP - See below for bug-fixed version It creates the shortcut in the current directory but doesn't let me create the file in a folder. If I put a full path in the filename it doesn't do anything. Strangely, if I comment out the graphics() command it doesn't work! |
| ||
You could always use your current code to create the shortcut then "move" it into the required folder using RenameFile(). |
| ||
Cheers @Chalky, After adding CoInitialize() / CoUninitialise() to the call it seems to work okay now. I've added support for icons etc and this now seems to be working fine. Let me know if you find anything wrong or that can be improved. Use Bruceys bah.volumes module to get the users desktop. CreateShortcut.bmx TShortcut.bmx shortcut.c |