Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2007 Jul : Extracting link target name from .pif files

www.cryer.info
Managed Newsgroup Archive

Extracting link target name from .pif files

Subject:Extracting link target name from .pif files
Posted by:"Joe H" (joedot..@att.net)
Date:22 Jul 2007 13:44:22

I have a function, GetTarget, written by Zarko Gaijic but I've found
many other examples of it that are almost identical. Anyway this
function uses IshellLink and IPersistfile to load the shortcut file and
extract the pathname. This function properly extracts the target
filename for .lnk files but always returns an empty string for .pif
files. (I've used a similar function for years to successfully create
shortcuts for .pif and .lnk files.)

I've found the pif_mgr functions in the help file, but they provide
absolutely no information about using them and I've not found any on a
google search but the note in the help says that these functions were
introduced by XP service pack 2 and may not be available in the future
so that does not sound like something I want to try to use.

It would take about two minutes write a function to just read the .pif
file as a stream and extract the target filename (or any other standard
information) from that file. However, I fear that windows may stop that
from working at some future time. (Granted the use itself of pif files
is probably more limited!)

Does anyone know of a windows way that actually works to extract the
target filename from a pif file, or is the best approach to just read
the file and extract the needed information from the structured layout.
I've had the pif file layout available for ages and have used it to
modify .pif files for dos programs in the past, for example: to set
things like Run in a Window or Run in Full Screen Mode and Close on
exit (the default setting on XP but not on previous windows versions).

Thanks.
--

Replies:

www.cryer.info
Managed Newsgroup Archive