Solved

resolve shortcut/link

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert Jpg /PNG To GIF 5 135
Delphi: how to implement a User Shortcut mapper? 1 109
Delphi IDE crash without error message ... 7 89
Reconfigure Delphi Install? 2 51
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 I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

776 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