I
import
Unregistered / Unconfirmed
GUEST, unregistred user!
有一个变态的方法: 首先创建一个ShortCut,然后运行这个ShortCut即可。
procedure RunNetHood;
var
anobj:IUnknown;
shlink:IShellLink;
pFile:IPersistFile;
pidlItemIDList;
begin
anobj:=CreateComObject(CLSID_SHELLLINK);
SHGetSpecialFolderLocation( application.Handle , CSIDL_NETWORK, pidl);
shlink:=anobj as IShellLink;
pFile:=anobj as IPersistFile;
shlink.SetIDList(pidl);
shlink.SetShowCmd(sw_show);
pFile.Save('C:.lnk',false);
ShellExecute(0,'open','C:.lnk',nil,nil,sw_show);
DeleteFile('C:.lnk');
end;
请参看打开回收站的方法,那个方法比较好!
*******************************************
下面是一个比较好的方法:
请参看函数OpenSpecialFolder,其中,FolderID可以为
CSIDL_BITBUCKET
CSIDL_CONTROLS
CSIDL_DESKTOP
CSIDL_DESKTOPDIRECTORY
.........
procedure RunNetHood;
var
anobj:IUnknown;
shlink:IShellLink;
pFile:IPersistFile;
pidlItemIDList;
begin
anobj:=CreateComObject(CLSID_SHELLLINK);
SHGetSpecialFolderLocation( application.Handle , CSIDL_NETWORK, pidl);
shlink:=anobj as IShellLink;
pFile:=anobj as IPersistFile;
shlink.SetIDList(pidl);
shlink.SetShowCmd(sw_show);
pFile.Save('C:.lnk',false);
ShellExecute(0,'open','C:.lnk',nil,nil,sw_show);
DeleteFile('C:.lnk');
end;
请参看打开回收站的方法,那个方法比较好!
*******************************************
下面是一个比较好的方法:
请参看函数OpenSpecialFolder,其中,FolderID可以为
CSIDL_BITBUCKET
CSIDL_CONTROLS
CSIDL_DESKTOP
CSIDL_DESKTOPDIRECTORY
.........