Click here to Skip to main content
15,883,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: query for mac os - for registry? Pin
Maximilien24-May-11 0:54
Maximilien24-May-11 0:54 
Questionhtml string in .lnk file Pin
limelect23-May-11 20:47
limelect23-May-11 20:47 
AnswerRe: html string in .lnk file Pin
ShilpiP23-May-11 22:50
ShilpiP23-May-11 22:50 
GeneralRe: html string in .lnk file Pin
limelect24-May-11 20:44
limelect24-May-11 20:44 
GeneralRe: html string in .lnk file Pin
ShilpiP24-May-11 21:09
ShilpiP24-May-11 21:09 
GeneralRe: html string in .lnk file Pin
limelect24-May-11 21:18
limelect24-May-11 21:18 
GeneralRe: html string in .lnk file Pin
ShilpiP24-May-11 21:26
ShilpiP24-May-11 21:26 
GeneralRe: html string in .lnk file Pin
limelect24-May-11 21:45
limelect24-May-11 21:45 
It is a Delphi code but the sintax is the same

I have 2 code
second one is from jvcl
There are so many codes around i checked many none work for .lnk
I tried c++ code too
There is NO!! mistake in the code only to get the right function
to do the job
And This one dose not do the job either
http://www.codeproject.com/KB/shell/create_shortcut.aspx


var
IObject : IUnknown;
ISLink : IShellLink;
IPFile : IPersistFile;
p:PItemIDList;
TargetName : WideString;
LinkInfo: TShellLinkInfoStruct;
s: string;
AStr: array [0..MAX_PATH] of Char;
begin
TargetName:='C:\Documents and Settings\Administrator\Desktop\AVS Video Converter HD. Perfect for home video conversion. Convert video fast and easily!.lnk';
IObject := CreateComObject(CLSID_ShellLink) ;
ISLink := IObject as IShellLink;
IPFile := IObject as IPersistFile;
ISLink.SetPath(pChar(TargetName)) ;
{ Load file into IPersistFile object }
IPFile.Load(PWideChar(TargetName), STGM_READ);
{ Resolve the link by calling the Resolve interface function. }
ISLink.Resolve(0, SLR_UPDATE{ANY_MATCH} {or SLR_NO_UI});
{ Get all the info! }
ISLink.GetPath(AStr, MAX_PATH, LinkInfo.FindData, SLGP_RAWPATH);
ISLink.GetWorkingDirectory(AStr, MAX_PATH);

__________________________JVCL CODE __________________________________________

procedure GetShellLinkInfo(const LinkFile: WideString; var SLI: TShellLinkInfo);
{ Retrieves information on an existing shell link }
var
SL: IShellLink;
PF: IPersistFile;
FindData: TWin32FindData;
AStr: array [0..MAX_PATH] of Char;
begin
OleCheck(CoCreateInstance(CLSID_ShellLink, nil, CLSCTX_INPROC_SERVER,
IShellLink, SL));
{ The IShellLink implementer must also support the IPersistFile }
{ interface. Get an interface pointer to it. }
PF := SL as IPersistFile;
{ Load file into IPersistFile object }
OleCheck(PF.Load(PWideChar(LinkFile), STGM_READ));
{ Resolve the link by calling the Resolve interface function. }
OleCheck(SL.Resolve(0, SLR_ANY_MATCH or SLR_NO_UI));
{ Get all the info! }
with SLI do
begin
OleCheck(SL.GetPath(AStr, MAX_PATH, FindData, SLGP_SHORTPATH));
PathName := AStr;
OleCheck(SL.GetArguments(AStr, MAX_PATH));
Arguments := AStr;
OleCheck(SL.GetDescription(AStr, MAX_PATH));
Description := AStr;
OleCheck(SL.GetWorkingDirectory(AStr, MAX_PATH));
WorkingDirectory := AStr;
OleCheck(SL.GetIconLocation(AStr, MAX_PATH, IconIndex));
IconLocation := AStr;
OleCheck(SL.GetShowCmd(ShowCmd));
OleCheck(SL.GetHotKey(HotKey));
end;
end;
GeneralRe: html string in .lnk file Pin
ShilpiP24-May-11 22:36
ShilpiP24-May-11 22:36 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 0:44
limelect25-May-11 0:44 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 1:23
ShilpiP25-May-11 1:23 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 2:36
limelect25-May-11 2:36 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 3:04
ShilpiP25-May-11 3:04 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 3:23
limelect25-May-11 3:23 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 5:12
limelect25-May-11 5:12 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 19:38
ShilpiP25-May-11 19:38 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 19:47
limelect25-May-11 19:47 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 20:12
ShilpiP25-May-11 20:12 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 20:20
limelect25-May-11 20:20 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 20:41
ShilpiP25-May-11 20:41 
GeneralRe: html string in .lnk file Pin
limelect25-May-11 21:41
limelect25-May-11 21:41 
GeneralRe: html string in .lnk file Pin
ShilpiP25-May-11 22:24
ShilpiP25-May-11 22:24 
AnswerRe: html string in .lnk file Pin
Richard MacCutchan23-May-11 23:12
mveRichard MacCutchan23-May-11 23:12 
GeneralRe: html string in .lnk file Pin
limelect24-May-11 20:40
limelect24-May-11 20:40 
GeneralRe: html string in .lnk file Pin
Richard MacCutchan24-May-11 23:21
mveRichard MacCutchan24-May-11 23:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.