Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Launching Shortcuts (lnk files)

www.cryer.info
Managed Newsgroup Archive

Launching Shortcuts (lnk files)

Subject:Launching Shortcuts (lnk files)
Posted by:"Andrew Jameson" (conta..@softspotsoftware.com)
Date:Wed, 9 Mar 2005 10:24:38

Hi,
I need to be able to launch lnk files and obtain the PID for the launched
application ... I realize that not all apps will have a PID such as explorer
but most will.

I currently use CreateProcess and can therefore obtain the PID directly but
have to do a bit of preprocessing on the lnk file to get the executable name
from the lnk.

I now need to be able to deal with folder shortcuts and can't quite figure
out a 'nice' generic solution to launch such lnk files.

Backtracking a little, I experimented with ShellExecuteEx, passing it the
actual lnk file ... it deals with all that I want but I can't figure out how
to get anything that will enable me to get the PID ... as it's a lnk file,
even the hProcess returned value is zero.

So is there a way to preprocess a lnk file so that I can pass it on to
CreateProcess or is there another solution ? (by the way, I need it to work
with Windows 98 so stuff like GetProcessID won't be an option.)

Thanks

Andrew

Replies:

www.cryer.info
Managed Newsgroup Archive