//eg:ConnectToInternet('C:\Temp');
//eg:ConnectToInternet('http://www.sina.com');function ConnnectToInternet(Addr:String):Integer;
var
Rslt:LongBool;
StartupInfo:TStartupInfo;
ProcessInfo:TProcessInformation ;
IEPath:array [0..MAX_PATH] of Char;
IEName:String;
begin
GetWindowsDirectory(IEPath,MAX_PATH);
IEName:=IEPath+'\Explorer.exe '+Addr; 
FillChar(StartupInfo,sizeof(TStartupInfo),0);
with StartupInfo do
  begin
    cb:=sizeof(TStartupInfo);
    dwFlags:=STARTF_USESHOWWINDOW or STARTF_FORCEONFEEDBACK;
    wShowWindow:=SW_MAXIMIZE;
  end;
Rslt:=CreateProcess(nil,Pchar(IEName),nil,nil,false,
    NORMAL_PRIORITY_CLASS,nil,nil,StartupInfo,ProcessInfo);
if Rslt then
with ProcessInfo do
begin
  WaitForInputIdle(hProcess,INFINITE);
  CloseHandle(hThread);
  CloseHandle(hProcess);
  Result:=0;
end
else Result:=GetLastError;
end;

解决方案 »

  1.   

     Winexec('Explorer.exe c:\temp',SW_Show);
      

  2.   

    用ShellExecute更简单。
    HINSTANCE ShellExecute(    HWND hwnd, // handle to parent window
        LPCTSTR lpOperation, // pointer to string that specifies operation to perform
        LPCTSTR lpFile, // pointer to filename or folder name string
        LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters 
        LPCTSTR lpDirectory, // pointer to string that specifies default directory
        INT nShowCmd  // whether file is shown when opened
       );
      

  3.   

    具体可以看Delphi的win32 SDK Help. :)You can use ShellExecute to open or explore a shell folder. To open a folder, use either of the following calls:ShellExecute(handle, NULL, path_to_folder, NULL, NULL, SW_SHOWNORMAL);or
      ShellExecute(handle, "open", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
      To explore a folder, use the following call:ShellExecute(handle, "explore", path_to_folder, NULL, NULL, SW_SHOWNORMAL);
      If lpOperation is NULL, the function opens the file specified by lpFile. If lpOperation is "open" or "explore", the function will force an open window or explorer.
      

  4.   

    我不知道怎么用API函数,请给我具体代码。