Главная страницаОбратная связьКарта сайта

Как показать Open With диалог

Автор: http://www.swissdelphicenter.ch

{
  This code displays the application/file "Open With" dialog
  Passing the full file path and name as a parameter will cause the
  dialog to display the line "Click the program you want to use to open
  the file "filename"".
}

uses
  ShellApi;

procedure OpenWith(FileName: string);
begin
  ShellExecute(Application.Handle, "open", PChar("rundll32.exe"),
    PChar("shell32.dll,OpenAs_RunDLL " + FileName), nil, SW_SHOWNORMAL);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  if Opendialog1.Execute then
    OpenWith(Opendialog1.FileName);
end;

Обсудить статью на форуме


Если Вас заинтересовала или понравилась информация по разработке на Delph - "Как показать Open With диалог", Вы можете поставить закладку в социальной сети или в своём блоге на данную страницу:

Так же Вы можете задать вопрос по работе этого модуля или примера через форму обратной связи, в сообщение обязательно указывайте название или ссылку на статью!
   


Copyright © 2008 - 2024 Дискета.info