ShellLinkの件、もしかして VB のようにやりたいという事なら
procedure TForm1.Button1Click(Sender: TObject);
var guid:TGUID;
var objShell : OLEVariant;
var objFolder : OLEVariant;
var objFolderItems: OLEVariant;
var objFolderItem : OLEVariant;
var lk:OLEVariant;
var LNKpath,LNKname:WideString;
begin
LNKpath:='C:\Documents and Settings\Administrator\SendTo';
LNKname:='K2Grep.LNK';
guid:=ProgIDToClassID('Shell.Application');
objShell := CreateComObject(guid) as IDispatch;
objFolder := objShell.NameSpace( OLEVariant(LNKpath)) ;
objFolderItems:= objFolder.Items ;
objFolderItem := objFolderItems.Item(OLEVariant(LNKname));
lk:= objFolderItem.GetLink;
Caption:=lk.Path;
end;
とOleVariantを使って IShellLinkではなくShellLinkObjectを使えばいいのでは?
IDispatchでは遅いという事なら、 ActiveXの取り込みで Shell32.dll を取り込んでおいて
procedure TForm1.Button2Click(Sender: TObject);
var guid:TGUID;
var objShell : IShellDispatch;
var objFolder : Folder;
var objFolderItem: FolderItem;
var lk:IShellLinkDual2 ;
var path,LNKname:WideString;
begin
path:='C:\Documents and Settings\Administrator\SendTo';
LNKname:='K2Grep.LNK';
guid:=ProgIDToClassID('Shell.Application');
objShell := CreateComObject(guid) as IShellDispatch ;
objFolder := objShell.NameSpace(path);
objFolderItem:=(objFolder.Items as FolderItems).Item(LNKname);
lk:= objFolderItem.GetLink as IShellLinkDual2;
Caption:=lk.Path;
end;
とすれば、良いと思う