包括桌面上那种。
解决方案 »
- dxDBTreeView控件(DevExpress DBTree Suite控件)如何判断滚动事件
- cannot perform this operation on a closed dataset
- Delphi7.0问题
- Delphi使用VB控件全攻略!!(~~并向昨天看不到文章的朋友致歉)
- DELPHI中的图表控件CHART的使用问题
- 哪里有Windows API参考大全这种书的电子版的,我的qq是45820894
- MSDE安装后,如何生成和管理数据库? …………在线等待
- 跪求智者,本人刚完成一个c/s的项目,用的delphi开发,现想将client通过ocx放入IE中,该如何实现啊?
- 关于顶贴机
- Delphi中的一些对话框如何汉化,如MessageDlg,报表预览等?没分了抱歉
- 如何知道一个有重复数据的数组中不相同数据的个数?紧急求救!
- 一个连接数据库的问题,98连接WIN 2000Server为什么不行?
你的可以用写字版打开一个快捷方式的文件。
里面是有指向的文件路径和文件名
所以只要用FileOpen打开*.lnk,读出相应的目标就行了。
桌面上的和别的地方的是一样的。
不过有一点,桌面上的“我的电脑”“网上邻居”等不是快捷方式。
等会回去我给你 在我电脑里
我一直在研究不知道这是什么玩意儿??不知有哪位高手知道??
shellexecute(handle,'open','start.exe','c:\windows\desktop\aaa.lnk','',sw_hide);
如果想创建快捷方式
function CreateLinkFile(const info:LINK_FILE_INFO;const DestFileName:string=''):boolean;
var
anobj:IUnknown;
shlink:IShellLink;
pFile:IPersistFile;
wFileName:widestring;
begin
wFileName:=destfilename;
anobj:=CreateComObject(CLSID_SHELLLINK);
shlink:=anobj as IShellLink;
pFile:=anobj as IPersistFile;
shlink.SetPath(info.FileName);
shlink.SetWorkingDirectory(info.WorkDirectory);
shlink.SetDescription(info.Description);
shlink.SetArguments(info.Arguments);
shlink.SetIconLocation(info.IconLocation,info.IconIndex);
shlink.SetHotkey(info.HotKey);
shlink.SetShowCmd(info.ShowState);
shlink.SetRelativePath(info.RelativePath,0);
if DestFileName='' then
wFileName:=ChangeFileExt(info.FileName,'lnk');
result:=succeeded(pFile.Save(pwchar(wFileName),false));
end;
function LinkFileInfo(const lnkFileName:string;var info:LINK_FILE_INFO;const bSet:boolean):boolean;
var
hr:hresult;
psl:IShelllink;
wfd:win32_find_data;
ppf:IPersistFile;
lpw:pwidechar;
buf:pwidechar;
begin
result:=false;
getmem(buf,MAX_PATH);
try
if SUCCEEDED(CoInitialize(nil)) then
if (succeeded(cocreateinstance(clsid_shelllink,nil,clsctx_inproc_server,IID_IShellLinkA,psl))) then
begin
hr:=psl.QueryInterface(iPersistFile,ppf);
if succeeded(hr) then
begin
lpw:=stringtowidechar(lnkfilename,buf,MAX_PATH);
hr := ppf.Load(lpw, STGM_READ);
if succeeded(hr) then
begin
hr := psl.Resolve(0, SLR_NO_UI);
if succeeded(hr) then
begin
if bSet then
begin
psl.SetArguments(info.Arguments);
psl.SetDescription(info.Description);
psl.SetHotkey(info.HotKey);
psl.SetIconLocation(info.IconLocation,info.IconIndex);
psl.SetIDList(info.ItemIDList);
psl.SetPath(info.FileName);
psl.SetShowCmd(info.ShowState);
psl.SetRelativePath(info.RelativePath,0);
psl.SetWorkingDirectory(info.WorkDirectory);
if succeeded(psl.Resolve(0,SLR_UPDATE)) then
result:=true;
end
else
begin
psl.GetPath(info.FileName,MAX_PATH, wfd,SLGP_SHORTPATH );
psl.GetIconLocation(info.IconLocation,MAX_PATH,info.IconIndex);
psl.GetWorkingDirectory(info.WorkDirectory,MAX_PATH);
psl.GetDescription(info.Description,CCH_MAXNAME);
psl.GetArguments(info.Arguments,MAX_PATH);
psl.GetHotkey(info.HotKey);
psl.GetIDList(info.ItemIDList);
psl.GetShowCmd(info.ShowState);
result:=true;
end;
end;
end;
end;
end;
finally
freemem(buf);
end;
end;
var
vItemIDList: PItemIDList;
vBuffer: array[0..MAX_PATH] of Char;
begin
SHGetSpecialFolderLocation(0, mFolder, vItemIDList);
SHGetPathFromIDList(vItemIDList, vBuffer); //转换成文件系统的路径
Result := vBuffer;
end;