Solved

resolve shortcut/link

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

760 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

21 Experts available now in Live!

Get 1:1 Help Now