OpenWithDlg function
Shell utilities routines
Return to Introduction  Previous page  Next page
Unit
acUtils  

Declaration
function OpenWithDlg(FileName: String): Boolean;//True if succeed  

Description
The OpenWithDlg function executes "Open With" dialog for file specified by FileName parameter. The "Open With" dialog mostly used to execute file with unknown type and specify which program can execute that file. Function returns True if succeed or False otherwise.  

Original code
function OpenWithDlg(FileName: String): Boolean;  
begin  
  try  
    Result := WinExec(PChar('rundll32 shell32,OpenAs_RunDLL ' + FileName), SW_SHOWNORMAL) > 31;  
  except  
  end;  
end;