Solved

resolve shortcut/link

Posted on 1998-02-27
4
468 Views
Last Modified: 2010-04-06
I wan't to open a file, if it is a dropped shortcut from the WIN95-Explorer.
At the moment I receive a file namend xxxx.lnk. I think I could use IShellLink.
I found examples how to create a shortcut, but none to resolve it.
If a *.lnk is dropped, I want to know the path and filename to which it points to.
0
Comment
Question by:volkerloges
  • 2
  • 2
4 Comments
 
LVL 4

Accepted Solution

by:
itamar earned 100 total points
ID: 1359879
Hi volkerloges,

I use a free component that manipulates shortcuts. Yes, it creates shortcuts, but also READS it, with a ... Read method and properties that give you all the information about the source of the link. simple like that:

  PBShellLink1.FileName := OpenDialog1.FileName;
  PBShellLink1.Read;
  Edit1.Text := PBShellLink1.Description;
  Edit2.Text := PBShellLink1.WorkingDir;
  Edit3.Text := PBShellLink1.Target; //<<< This is the one

It's freeware and the source code is included. Give it a try:

http://www.torry.webnorth.com/vcl/system/shelllnk.zip

IHTH,
Itamar

0
 
LVL 1

Author Comment

by:volkerloges
ID: 1359880
Hello itamar,

thank you for your answer.
Unfortunately the recommended files doesn't contain any information about how to 'resolve' a shortcut. I think about that automatic Dialog that opened, if the file the shortcut points to was moved. Do you have any information how to do a resolve?

Volker

0
 
LVL 4

Expert Comment

by:itamar
ID: 1359881
Hi Volker,

You mean a lost shortcut, i.e., if someone moves a sorce file from the original path that was set in shortcut ? No way !!!

The dialog you mentioned must be launched by YOUR application when it cannot open the target file !

It will be just a warning with a Open dialog option to the user find the file himself, and/or a procedure that will search the entire Hard-disk(s). There is nothing else. Believe me !

Tell me if you want some help with this dialog !

Bye,
Itamar
0
 
LVL 1

Author Comment

by:volkerloges
ID: 1359882
hello itamar,
after fiddling with the source you mentionend earlier, i found
a simple solution: psl.resolve(Application.Handle, SLR_UPDATE)
does the job. BTW: The Source works also for older Delphi
releases and because of this fact is loaded with code for that
releases. With Delphi 3, the resolve function fits in 82 lines.
Thank your for your comments.
Volker
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question