怎样调用“查找计算机”对话框?(50分)

  • 主题发起人 主题发起人 rockroll
  • 开始时间 开始时间
R

rockroll

Unregistered / Unconfirmed
GUEST, unregistred user!
我想在自己的程序里调用Windows的“查找计算机”对话框,该如何实现呢?
 
I get the infromation from borland.com, Found it!<br><br>function FindComputer: string<br>var<br>&nbsp; BrowseInfo: TBrowseInfo;<br>&nbsp; ItemIDList: PItemIDList;<br>&nbsp; ComputerName: array[0..MAX_PATH] of Char;<br>&nbsp; Title: string;<br>&nbsp; WindowList: Pointer;<br>begin<br>&nbsp; if not Failed(SHGetSpecialFolderLocation(Application.Handle,<br>CSIDL_NETWORK, ItemIDList)) then<br>&nbsp; begin<br>&nbsp; &nbsp; FillChar(BrowseInfo, SizeOf(BrowseInfo), 0);<br>&nbsp; &nbsp; BrowseInfo.hwndOwner := Application.Handle;<br>&nbsp; &nbsp; BrowseInfo.pidlRoot := ItemIDList;<br>&nbsp; &nbsp; BrowseInfo.pszDisplayName := ComputerName;<br>&nbsp; &nbsp; Title := 'Select computer';<br>&nbsp; &nbsp; BrowseInfo.lpszTitle := PChar(Pointer(Title));<br>&nbsp; &nbsp; BrowseInfo.ulFlags := BIF_BROWSEFORCOMPUTER;<br>&nbsp; &nbsp; WindowList := DisableTaskWindows(0);<br>&nbsp; &nbsp; try<br>&nbsp; &nbsp; &nbsp; if SHBrowseForFolder(BrowseInfo) &lt;&gt; nil<br>&nbsp; &nbsp; &nbsp; then Result:= ComputerName;<br>&nbsp; &nbsp; finally<br>&nbsp; &nbsp; &nbsp; EnableTaskWindows(WindowList);<br>&nbsp; &nbsp; end;<br>&nbsp; end;<br>end;<br><br>--<br>Best, Miha.<br>news:3a854c38_1@dnews...<br>&gt; How can I execute "Find Computer" dialog (like the one registered for<br>&gt; "ComputerName" property of say TDCOMConnection)? There must be a function to<br>&gt; do this, but I can not find it. Does anyone know the function name + unit<br>&gt; name in which it is declared?<br>&gt; --<br>&gt; Best, Miha.<br>&nbsp;<br><br>
 
可这段程序实现的是和Select Directory类似的Select Computer,不是“查找计算机”<br>对话框呀!您试过吗?
 
&nbsp; 自己编一个也不难呀,依着葫芦画瓢嘛
 
下面的函数在Win9x中可以:<br>function SHFindComputer(pidlRoot: PItemIDList; pidlSavedSearch: PItemIDList): Boolean;<br>&nbsp;stdcall; external 'Shell32.dll' index 91;<br>
 
学到不少,多谢各位;
 
多谢!接受答案了。
 
后退
顶部