现给你写了一个。想调用“1394 连接”、“无线网络连接”、“拨号连接”的属性,把程序里的 '本地连接' 改个名就行了。这个过程还可以删除、停用......“本地连接”,把 MakeIntResource 里的参数改了就行。<br>uses ComObj, ShlObj;<br><br>function GetDisplayName(ShellFolder: IShellFolder; PIDL: PItemIDList;<br> ForParsing: Boolean): string;<br>var<br> StrRet: _STRRET;<br> p: PChar;<br> nFlags: Integer;<br>begin<br> Result := '';<br> if ForParsing then<br> nFlags := SHGDN_FORPARSING<br> else<br> nFlags := SHGDN_NORMAL;<br><br> ShellFolder.GetDisplayNameOf(PIDL, nFlags, StrRet);<br> case StrRet.uType of<br> STRRET_CSTR:<br> SetString(Result, StrRet.cStr, lStrLen(StrRet.cStr));<br> STRRET_OFFSET:<br> begin<br> P := @PIDL.mkid.abID[StrRet.uOffset - SizeOf(PIDL.mkid.cb)];<br> SetString(Result, P, PIDL.mkid.cb - StrRet.uOffset);<br> end;<br> STRRET_WSTR:<br> Result := StrRet.pOleStr;<br> end;<br>end;<br><br>//hOwner:主窗口句柄;<br>procedure ShowLocalAreaConnection(hOwner: HWND);<br>const<br> Flags = SHCONTF_FOLDERS or SHCONTF_NONFOLDERS or SHCONTF_INCLUDEHIDDEN;<br>var<br> psf: IShellFolder;<br> pidl: PItemIDList;<br> pedl: IEnumIDList;<br> dwNum: LongWord;<br> pcm: IContextMenu;<br> ici: _CMINVOKECOMMANDINFO;<br>begin<br> SHGetDesktopFolder(psf);<br> SHGetSpecialFolderLocation(hOwner, CSIDL_CONTROLS, pidl);<br> psf.BindToObject(pidl, nil, IID_IShellFolder, Pointer(psf));<br> psf.EnumObjects(hOwner, Flags, pedl);<br> while pedl.Next(1, pidl, dwNum) = S_OK do<br> begin<br> if GetDisplayName(psf, pidl, False) = '网络连接' then<br> begin<br> psf.BindToObject(pidl, nil, IID_IShellFolder, Pointer(psf));<br> psf.EnumObjects(hOwner, Flags, pedl);<br> while pedl.Next(1, pidl, dwNum) = S_OK do<br> begin<br> if GetDisplayName(psf, pidl, False) = '本地连接' then<br> begin<br> psf.GetUIObjectOf(hOwner, 1, pidl, IID_IContextMenu, nil, pcm);<br> FillChar(ici, SizeOf(_CMINVOKECOMMANDINFO), #0);<br> with ici do<br> begin<br> cbSize := SizeOf(_CMINVOKECOMMANDINFO);<br> hwnd := hOwner;<br> lpVerb := MakeIntResource(8);<br> nShow := SW_SHOWNORMAL;<br> end;<br> pcm.InvokeCommand(ici);<br> Break;<br> end;<br> end;<br> Break;<br> end;<br> end;<br>end;