Windows - chamar a tela de pesquisa da api |
Top Previous Next |
|
uses ShlObj, ShellAPI, ActiveX;
procedure Pesquisa_da_API(PesquisarMeuComputador: Boolean); var pidl : PITEMIDLIST; PMalloc: IMalloc; sei : TShellExecuteInfo; begin try SHGetMalloc(PMalloc); ZeroMemory(@sei, sizeof(sei)); if PesquisarMeuComputador then begin SHGetSpecialFolderLocation(0,CSIDL_DRIVES,pidl); with sei do begin cbSize := SizeOf(sei); fMask := SEE_MASK_INVOKEIDLIST; lpVerb := 'find'; lpIDList := pidl; end; end else with sei do begin cbSize := SizeOf(sei); lpFile := PChar( 'C:\'); lpVerb := 'find'; end; ShellExecuteEx(@sei); finally pMalloc._Release; pMalloc := nil; end; end;
procedure TForm1.Button1Click(Sender: TObject); begin Pesquisa_da_API(True); end; |