WinExec

 

Description

Runs the specified application. For more info please check: http://msdn.microsoft.com/en-us/library/ms687393(VS.85).aspx

Syntax

int WinExec( LPCSTR lpCmdLine, UINT uCmdShow )

Parameters

lpCmdLine
[input] The command line (file name plus optional parameters) for the application to be executed.
uCmdShow
[input] The display options. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function.

Return

If the function succeeds, the return value is greater than 31. else the return value is one of the following error values.

0 =The system is out of memory or resources, 11= The .exe file is invalid, 2=The specified file was not found and 3= The specified path was not found.

Examples

EX1

void test_WinExec()
{

        WinExec("notepad",SW_SHOWNORMAL);
}

Remark

See Also

CreateProcess, TerminateProcess , GetExitCodeProcess, ShellExecute

header to Included

origin.h

Reference