This function loads and executes a Windows program or creates a new instance of an existing Windows program.
lpModuleName |
LPSTR Points to a null-terminated string that contains the filename of the application to be run. If the lpModuleName string does not contain a directory path, Windows will search for the executable file in this order: |
|
|
1.The current directory |
|
|
2.The Windows directory (the directory containing WIN.COM); the GetWindowsDirectory function obtains the pathname of this directory |
|
|
3.The Windows system directory (the directory containing such system files as KERNEL.EXE); the GetSystemDirectory function obtains the pathname of this directory |
|
|
4.The directories listed in the PATH environment variable |
|
|
5.The list of directories mapped in a network |
|
|
If the application filename does not contain an extension, then .EXE is assumed. |
|
lpParameterBlock |
LPVOID Points to a data structure consisting of four fields that defines a parameter block. This data structure consists of the following fields: |
|
|
Field |
Type/Description |
|
wEnvSeg |
WORD Specifies the segment address of the environment under which the module is to run; 0 indicates that the Windows environment is to be copied. |
|
lpCmdLine |
LPSTR Points to a null-terminated character string that contains a correctly formed command line. This string must not exceed 120 bytes in length. |
Parameter |
Type/Description |
|
The return value identifies the instance of the loaded module if the function was successful. Otherwise, it is a value less than 32 that specifies the error. The following list describes the error values returned by this function: