各位GGJJ  怎么调用WINDOWS下的打开方式程序  即在程序找不到运行环境出现的哪个用于选择打开方式的对话框  急,再线

解决方案 »

  1.   

    好像是rundll什么的,记不清了。
      

  2.   

    unit Unit1;interfaceuses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;type
      TForm1 = class(TForm)
        Button1: TButton;
        Edit1: TEdit;
        Button2: TButton;
        OpenDialog1: TOpenDialog;
        procedure Button2Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;  function OpenAs_RunDLL(const h:hwnd;b:hwnd;const filename:pchar;sw:integer=SW_SHOW):integer;stdcall;external 'shell32.dll' name 'OpenAs_RunDLL';var
      Form1: TForm1;implementation{$R *.dfm}procedure TForm1.Button2Click(Sender: TObject);
    var
      s  : string;
    begin
      if OpenDialog1.Execute then
      begin
        s := OpenDialog1.FileName;
        OpenAs_RunDLL(self.Handle, 0, PChar(s));
      end;
    end;end.