(*
/*

CLASS {NATIVE_Shortcut_info|_Delphi_KOL},
NATIVE,
ABSTRACT:

*/
*)

unit NATIVE_Shortcut_info;
{$I EXTERNAL_DEFINES.inc}

interface uses Windows, KOL, Lnk, ShlObj, ActiveX, ComObj;

function Call_Resolve_link(const Path_link: String): String;
procedure MakeShortcut(const filename, target_filename,
		arguments, workdir: String);

implementation

function Call_Resolve_link(const Path_link: String): String;
var Filename, Arguments, Workdir, Description: String;
    IconSmall, IconLarge: HIcon;
begin
    Result := '';
    if ResolveLink( Path_link, Filename, Arguments, Workdir, Description,
        IconSmall, IconLarge, FALSE, 0 ) then
        Result := Filename;
end;

procedure MakeShortcut(const filename, target_filename,
		arguments, workdir: String);
var SLink: IShellLink;
	AnObj: IUnknown;
	PFile: IPersistFile;
begin
	AnObj := CreateComObject (CLSID_ShellLink);
	SLink := AnObj as IShellLink;
	PFile := AnObj as IPersistFile;
		
	SLink.SetPath(PChar(target_filename));
	SLink.SetWorkingDirectory(PChar(workdir));
	SLink.SetArguments(PChar(arguments));
	PFile.Save(PWideChar(WideString( filename )), true);
end;


end.
(*
/*

CONST STR : NATIVE_Import_native_shortcut_info = @
            "uses NATIVE_Shortcut_info;"

            NATIVE_Resolve_link = @
            "   RESULT := Call_Resolve_link(X_Path);" 
            
            NATIVE_Create_link = @
            "	MakeShortcut(X_Path,X_Target,X_Arguments,X_Work);" .

*/
*)

end .

(*
/*
END
*/
*)
