Solved

resolve shortcut/link

Posted on 1998-02-27
4
476 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in July's Course of the Month

July's Course of the Month is now available! Enroll to learn HTML5 and prepare for certification. It's free for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month8 days, 4 hours left to enroll

617 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