这段程序的功能是调用计算器这个应用软件,它的路径是:“c:\windows\system32\calc.exe"
procedure Tmainsys.N21Click(Sender: TObject);
begin
winexec('c:\windows\system32\calc.exe');//这里有错误,但是我不知道怎么写
end;
end.

解决方案 »

  1.   

    Win32-based applications should use the CreateProcess function rather than this function. The WinExec function exists in Win32 to provide compatibility with earlier versions of Windows. For more information about how the WinExec function is implemented, see the Res section of the LoadModule function.
    这是DELPHI帮助里的,自己看看吧。
    WINEXEC是用来兼容早期的windows平台的应用程序。对于WIN32平台的应用程序应该使用CREATEPROCESS。
      

  2.   

    ShellExecute(handle,'open',PCHAR('calc.exe'),nil,PCHAR('c:\windows\system32\'),SW_SHOWNORMAL);
    引用单元:shellapi
      

  3.   

    uses ShellAPI;ShellExecute();//或者用WinExec()
      

  4.   

    function WinExec(lpCmdLine: LPCSTR; uCmdShow: UINT): UINT; stdcall;
    {$EXTERNALSYM WinExec}