>Hi George,
>
>Tks for your reply
>
>What I try to do is to get the linked file Name (and path) from the shortcut file.
>
>It work's fine with GetFile(), but I don't want a user prompt .
>
>So I try to do it with your LNKFILES.DLL but I seem's not possible for a document file ( only for exe ? ).
>
>Perhaps I can do it with a windows API ( commondlg ) without user prompt ?
If you have installed the Windows Scripting Host (Win98 systems, WinNT 4.0 with Option Pack 4, NT 5 betas, or having used the standalone WSH.EXE to install it), you might look at using the Wscript.Shell automation object to access your shortcut. The WScript.Shell has a method CreateShortut(), which returns a WshShortCut object. The command line could be accessed as follows:
oWShell = CREATEOBJ('Wscript.Shell')
oWShortCut = oWShell.CreateShortCut(cMyShortcutFilePathWithAnLNKExtension)
? oWShortcut.TargetPath
>
>Marcel
>
>>>Hi George,
>>>
>>>Tks for you last reply about Icon's.
>>>I am here again with another question
>>>
>>>I want to get the name and path of the Anulkid7a.rtf from the Shortcut in the foll. example.
>>>I always receive a empty string ?
>>>I try it with VFP6 and NT4
>>>
>>>Kindly advise .
>>>
>>>Check code ---------------------------------------
>>>
>>>DECLARE INTEGER GetLinkArgs IN LNKFILES.DLL;
>>> INTEGER hWnd, STRING @lpszLinkName, STRING @lpszArguments
>>>DECLARE INTEGER GetLinkDescription IN LNKFILES.DLL;
>>> INTEGER hWnd, STRING @lpszLinkName, STRING @lpszPath
>>>
>>>
>>>* 260 is the current value of MAX_PATH
>>>lcbuffer = SPACE(260)
>>>lclinkfile = "c:\temp\80879608\Shortcut to Anulkid7a.rtf.lnk"
>>>
>>>IF FILE(lcLinkFile)
>>>
>>> * lclinkfile is the file name of the link file
>>>-> 0 lnresult = GetLinkArgs(0, @lclinkfile, @lcbuffer)
>>> lcargs = LEFT(lcbuffer, lnresult)
>>>
>>>-> 0 lnresult = GetLinkDescription(0, @lclinkfile, @lcbuffer)
>>> lcdescription = LEFT(lcbuffer, lnresult)
>>>
>>>ENDIF
>>>
>>>RETURN
>>
>>Hi again Marcel,
>>
>>GetLinkArgs() will return an empty string if no parameters are passed to the executable. Since this is not an executable, but an RTF file, there are no parameters.
>>
>>Take a look at the Tips and Traps section of the help file for further information on GetLinkDescription(). This behavior is known, and the reason for the inclusion of the function in the DLL is explained.
>>
>>hth,