用这个更好,看执行的返回值,如果大于32就是成功
HINSTANCE ShellExecute(    HWND hwnd, // handle to parent window
    LPCTSTR lpOperation, // pointer to string that specifies operation to perform
    LPCTSTR lpFile, // pointer to filename or folder name string
    LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters 
    LPCTSTR lpDirectory, // pointer to string that specifies default directory
    INT nShowCmd  // whether file is shown when opened
   );

解决方案 »

  1.   

    觉得应该是
    BOOL CreateProcess(    LPCTSTR lpApplicationName, // pointer to name of executable module 
        LPTSTR lpCommandLine, // pointer to command line string
        LPSECURITY_ATTRIBUTES lpProcessAttributes, // pointer to process security attributes 
        LPSECURITY_ATTRIBUTES lpThreadAttributes, // pointer to thread security attributes 
        BOOL bInheritHandles, // handle inheritance flag 
        DWORD dwCreationFlags, // creation flags 
        LPVOID lpEnvironment, // pointer to new environment block 
        LPCTSTR lpCurrentDirectory, // pointer to current directory name 
        LPSTARTUPINFO lpStartupInfo, // pointer to STARTUPINFO 
        LPPROCESS_INFORMATION lpProcessInformation  // pointer to PROCESS_INFORMATION  
       );
    中的dwCreationFlags参数的设置问题,将其设置成CREATE_SUSPENDED后却将调用的程序挂起了,只执行Delphi程序.