在delphi中怎样从一个快捷方式(也就是*.lnk)中得到该快捷方式的可执行文件 从这个IShellLink名字的COM可以得到。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 unit Unit1;interfaceuses Windows, Messages, SysUtils, Classes,ShlObj, ComObj ,ActiveX, Controls, StdCtrls , Graphics, Forms, Dialogs;type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);var aObj: IUnknown; MyPFile: IPersistFile; MyLink: IShellLink; WFileName: WideString; FileName:array[0..255] of char; pfd:WIN32_FIND_DATA;begin aObj := CreateComObject(CLSID_ShellLink); MyPFile := aObj as IPersistFile; MyLink := aObj as IShellLink; WFileName := 'C:\Delphi.lnk'; MyPFile.Load(PWChar(wfilename), 0); MyLink.GetPath(FileName,255,pfd,SLGP_UNCPRIORITY); showmessage(String(FileName));end;end. 非常感谢black_fox(black_fox) ,我试试看! 数据库更新时数据类型的问题。 改用Delphi调用动态库(原C#调用动态库) 哪位大哥,可以帮帮手,看看问题出左哪? 是不是我把问题发错版了?SOCKET的东西啊. 求一个API函数,小弟急用~~100分一个小KS,大家帮帮忙找一下.在线等候....... 这样获得当前记录指针? 如何获得tlistbox的当前双击项的名称(不用循环判断select)???? 急,哪里有这个文件下载 安装完fastreport,没有fr_class Soap Soap Soap Soap Soap Soap Soap Soap Soap Soap Soap Soap 不防一看 救命啊,我的所有东东全没了
interface
uses
Windows, Messages, SysUtils, Classes,ShlObj, ComObj ,ActiveX, Controls,
StdCtrls , Graphics, Forms, Dialogs;
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.DFM}procedure TForm1.Button1Click(Sender: TObject);
var
aObj: IUnknown;
MyPFile: IPersistFile;
MyLink: IShellLink;
WFileName: WideString;
FileName:array[0..255] of char;
pfd:WIN32_FIND_DATA;
begin
aObj := CreateComObject(CLSID_ShellLink);
MyPFile := aObj as IPersistFile;
MyLink := aObj as IShellLink;
WFileName := 'C:\Delphi.lnk';
MyPFile.Load(PWChar(wfilename), 0);
MyLink.GetPath(FileName,255,pfd,SLGP_UNCPRIORITY);
showmessage(String(FileName));end;end.