procedure TForm1.SpeedButton1Click(Sender: TObject);
var  wpath :String;
begin
wpath:=extractfilepath(paramstr(0));
wpath:=wpath+'\exe';
winexec(pchar(wpath),Treg.exe);//报错:未声明标识'Treg'
end;
请教如何解决啊!

解决方案 »

  1.   

    还是报错:undeclared indentifier:'Treg'.
    怎么回事啊,Treg.exe是不是要引用啊
      

  2.   

    to:jinjazz
    winexec('Treg.exe',1);//
    1是什么做用啊,没有报错,但运行后没有执行Treg程序啊!
      

  3.   

    The WinExec function runs the specified application. This function is provided for compatibility with earlier versions of Windows. For Win32-based applications, use the CreateProcess function. UINT WinExec(    LPCSTR lpCmdLine, // address of command line 
        UINT uCmdShow  // window style for new application 
       );
     ParameterslpCmdLinePoints to a null-terminated character string that contains the command line (filename plus optional parameters) for the application to be executed. If the name of the executable file in the lpCmdLine parameter does not contain a directory path, Windows searches for the executable file in this sequence: 1. The directory from which the application loaded. 
    2. The current directory. 
    3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory. 
    4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory. 
    5. The directories listed in the PATH environment variable.  uCmdShowSpecifies how a Windows-based application window is to be shown and is used to supply the wShowWindow member of the STARTUPINFO parameter to the CreateProcess function. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function. For a non-Windows - based application, the PIF file, if any, for the application determines the window state.  Return ValuesIf the function succeeds, the return value is greater than 31.
    If the function fails, the return value is one of the following error values:
      

  4.   

    这个帮助你能看懂吧
    winexec(pchar(wpath+Treg.exe),SW_SHOWNORMAL);
    大概是可以这样写,
      

  5.   

    to:快感
    行了,winexec(pchar(wpath+‘Treg.exe’),1);帮助看懂了一些,但不是很清楚。
    你有没有中文的啊!