Solved

resolve shortcut/link

Posted on 1998-02-27
4
463 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now