--------------------------------------------------------------------------- CmdLine - ������ ��������� ������
| 862 | //--------------------------------------------------------------------------- |
| 863 | // CmdLine - ������ ��������� ������ |
| 864 | bool RunProg(char * CmdLine, WORD wShowWindow, bool bWait, |
| 865 | DWORD * pExitCode, char * szCurDir, DWORD * pdwProcessId) |
| 866 | { |
| 867 | bool RetVal; |
| 868 | STARTUPINFO si; |
| 869 | PROCESS_INFORMATION pi; |
| 870 | GetStartupInfo(&si); |
| 871 | si.wShowWindow = wShowWindow; |
| 872 | |
| 873 | RetVal = CreateProcess(NULL, CmdLine, NULL, NULL, FALSE, |
| 874 | NORMAL_PRIORITY_CLASS, NULL, szCurDir, &si, &pi); |
| 875 | |
| 876 | if( RetVal ) |
| 877 | { |
| 878 | if( bWait ) |
| 879 | WaitForSingleObject(pi.hProcess, INFINITE); |
| 880 | |
| 881 | if( pExitCode ) |
| 882 | GetExitCodeProcess(pi.hProcess, pExitCode); |
| 883 | } |
| 884 | else |
| 885 | { |
| 886 | if( pExitCode ) |
| 887 | *pExitCode = GetLastError(); |
| 888 | } |
| 889 | |
| 890 | CloseHandle(pi.hProcess); |
| 891 | CloseHandle(pi.hThread); |
| 892 | if( pdwProcessId ) |
| 893 | *pdwProcessId = pi.dwProcessId; |
| 894 | return RetVal; |
| 895 | } |
| 896 | //--------------------------------------------------------------------------- |
| 897 | #if !defined(DANFOSS) |
| 898 | bool RunTelnet(AnsiString params) |
no outgoing calls
no test coverage detected