Is there a way for a Windows program to find out what shortcut (i.e. .lnk file), if any, it was invoked from, so that it can pick up the shortcut’s icon?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can call
GetStartupInfo()to fill aSTARTUPINFOstructure. If theSTARTF_TITLEISLINKNAMEflag is set, theSTARTUPINFO::lpTitlefield contains the path to the.lnkfile.(This was undocumented for a long time. It probably works all the way back to Win95).