| View previous topic :: View next topic |
| Author |
Message |
José Guest
|
Posted: Fri Apr 21, 2006 10:03 am Post subject: Resolving a shortcut |
|
|
I read a file with the LNK extension. How to find the file it refers
to?
--
José |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
|
| Back to top |
|
 |
José Guest
|
Posted: Sat Apr 22, 2006 5:03 pm Post subject: Re: Resolving a shortcut |
|
|
On Fri, 21 Apr 2006 03:04:14 -0700, "Remy Lebeau \(TeamB\)"
<no.spam (AT) no (DOT) spam.com> wrote in borland.public.cppbuilder.nativeapi:
It's pretty complicated. I am surprised that there is no such thing as
a simple function: String ResolveShortCut (String lnkfile);
Besides, I may be a dunce, but the function ResolveIt on the website
doesn't compile:
(190): E2451 Undefined symbol 'IShellLink'.
(198): E2268 Call to undefined function 'CoCreateInstance'.
(198): E2451 Undefined symbol 'CLSID_ShellLink'.
(199): E2451 Undefined symbol 'IID_IShellLink'.
(202): E2451 Undefined symbol 'IPersistFile'.
(205): E2451 Undefined symbol 'IID_IPersistFile'.
(218): E2451 Undefined symbol 'STGM_READ'.
(231): E2451 Undefined symbol 'SLGP_SHORTPATH'.
(240): E2268 Call to undefined function 'StringCbCopy'.
(248): E2268 Call to undefined function 'HandleErr'.
--
José |
|
| Back to top |
|
 |
Hans Galema Guest
|
Posted: Sun Apr 23, 2006 8:03 am Post subject: Re: Resolving a shortcut |
|
|
José wrote:
| Quote: | It's pretty complicated. I am surprised that there is no such thing as
a simple function: String ResolveShortCut (String lnkfile);
|
Then why not write your own ?
If you open a .lnk file in notepad you can see that the requested
path is behind 'Data '.
Knowing that, you can extract it.
Hans. |
|
| Back to top |
|
 |
José Guest
|
Posted: Sun Apr 23, 2006 1:03 pm Post subject: Re: Resolving a shortcut |
|
|
On Sun, 23 Apr 2006 09:19:31 +0200, Hans Galema <notused (AT) notused (DOT) nl>
wrote in borland.public.cppbuilder.nativeapi:
| Quote: | It's pretty complicated. I am surprised that there is no such thing as
a simple function: String ResolveShortCut (String lnkfile);
Then why not write your own ?
If you open a .lnk file in notepad you can see that the requested
path is behind 'Data '.
|
Sure, I have already programmed lots of functions without knowing that
they already existed.
--
José |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Apr 24, 2006 7:03 pm Post subject: Re: Resolving a shortcut |
|
|
"José" <jose (AT) 127 (DOT) 0.0.1> wrote in message
news:rtjk42t6426h38shott0522k1on8evq50r (AT) 4ax (DOT) com...
| Quote: | It's pretty complicated.
|
Welcome to Shell programming. Most things in the Windows Shell is exposed
as COM interfaces.
| Quote: | I am surprised that there is no such thing as a simple function: String
ResolveShortCut (String lnkfile); |
The article I pointed you to has the code for such a function.
| Quote: | Besides, I may be a dunce, but the function ResolveIt on
the website doesn't compile:
|
Works fine for me. You probably did not include shlobj.h into your code.
Note that for shlobj.h, if you are using BCB 5 or higher, you need to add
NO_WIN32_LEAN_AND_MEAN to the Conditionals list in the Project Options.
Note also that StringCbCopy() is declared in strsafe.h, which is not shipped
with BCB at all. So you will have to download the latest Borland Platform
SDK from http://bccsdk.sourceforge.net in order to use it. Otherwise, use
strncpy() instead
Gambit |
|
| Back to top |
|
 |
|