Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create a shortcut
Message
 
To
14/05/2002 13:28:57
Emerson Reed
Folhamatic Tecnologia Em Sistemas
Americana - São Paulo, Brazil
General information
Forum:
Visual FoxPro
Category:
Installation, Setup and Configuration
Miscellaneous
Thread ID:
00654108
Message ID:
00656319
Views:
19
>If the icon is "attached" (I don't know the correct word in english) in the exe, the shortcut icon appears correctly.
>The shortcut is created correctly but if I try to configure any property (iconfile, workdir) the -3 error code is returned.
>When I use FILE() to know if the shortcut already exists, function always return .F. and a new shortcut is created with the same name including (2), (3), ...
>It seems like both VFP and your dll don't find the shortcut file created.
>If you need, I can be the beta tester... :)
>
>Tks,
>
Emerson,

I can't replicate the problem under Win2K. I did notice that SetLinkWorkDir() returns 1 on success. Here's the code I used to test:
lcfile = GETFILE('EXE')
lcicon = GETFILE('ico')
DECLARE INTEGER FindDesktopFolder IN LNKFILES.DLL;
  INTEGER hOwner, STRING @lpbuffer
lcbuffer = SPACE(260)
? FindDesktopFolder(0, @lcbuffer) && Returns 41
lcdesktop = LEFT(lcbuffer, 41)
lcshortcut = ADDBS(lcdesktop) + "Test.lnk"
DECLARE INTEGER CreateShellLink IN LNKFILES.DLL;
  STRING @lpzLinkFileName, STRING @lpzExeFileName
? CreateShellLink(@lcshortcut, @lcfile) && Returns 0
DECLARE INTEGER SetLinkWorkDir IN LNKFILES.DLL;
  INTEGER hWnd, STRING @lpszLinkName, STRING @lpszPath
? SetLinkWorkDir(0, @lcshortcut, JUSTPATH(lcfile)) && Returns 1 but the directory is set appropriately
DECLARE INTEGER SetLinkIconFile IN LNKFILES.DLL;
  INTEGER hWnd, STRING @lpszLinkName,;
  STRING @lpszPath, INTEGER iIconIndex
? SetLinkIconFile(0, @lcshortcut, @lcicon, 0) Returns 0
I really don't have any plans for updating or modifying the file as I now use the Windows Script Host to create and modify short cuts.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform