我想在程序中调用windows的画图程序应该怎么写代码

解决方案 »

  1.   


    res:=winexec('c:\winnt\system32\mspaint.exe',SW_SHOW);
      

  2.   

    var
      S:String;
    begin
      SetLength(S,255);
      GetSystemDirectory(PChar(S),255);
      Winexec(PChar(S+'\mspaint.exe'),SW_SHOW);
    end;
      

  3.   

    Win32上最好用ShellExecute:
    ---------------------------------implementation{$R *.DFM}
       uses ShellAPI;procedure TForm1.Button1Click(Sender: TObject);
    begin
      ShellExecute(Application.Handle,'Open',PChar('mspaint'),nil,nil,SW_SHOWNORMAL);
      //ShellExecute(Application.Handle,'Open',PChar('%systemroot%/system32/mspaint'),nil,nil,SW_SHOWNORMAL);
    end;
    我爱Delphi!