WinExec Function
Runs the specified appłication.
Notę: Tbis function is pravided only for campatibility with 16-bit Windows. Applications should use the CreateProcess function.
Syntax
UINT WINAPI WinExec(
_in LPCSTR lpCmdLine,
_in UINT uCmdShow
Parameters lpCmdLine [in]
The command linę (file name plus optional parameters) for the appłication to be executed If the name of the executable file in the lpCmdLine parameter does not contain a directory path, the system searches for the executable file in this seąuence:
1. The directory from which the appłication loaded,
2. The current directory.
3. The Windows system directory (GetSystemDirectary).
4. The Windows directory (GefWindowsDirectory).
5. The directories listed in the PATH environment variable.
uCmdShow [in]
Specifies how the windaw is to be shown This parameter is ignored the first time an apphcation calls ShowWindow, if the program that larmched the appłication provides a STARTU PINFO structure. Otherwise, the first time ShowWindow is called, the value should be the value obtained by the WinM ain function in its nCmriShowparameter, In subseąuent calls, this parameter can be one of the following values.
SW_FORCEMINIMIZE
Windows 2000/XP: Minimizes a window, even if the fhread that owns the window is not responding, This flag should only be used when minimizing Windows from a different thread. SW_HIDE
Hides the window and activates another window.
SW_MAXIMIZE
Maximizes the specified window.
SW_MINIM IZE
Minimizes the specified window and activatES the next top-leveł window in the Z order.
SW_RE STORĘ
Activates and displays the window. If the windaw is minimized or rnaximized, the system restores it to its original size and position An apphcation should specify tbis flag when restoring a minimized windaw.
SW_SHOW
Activates the window and displays it in its current size and position,
SW_SHOWDEFAULT
Sets the show State based on the SW_ value specified in the STARTUPINFO structure passed to the CreateProcess function by the program that started the appłication.
SW_SH OWM AX IM IZED
Activates the window and displays it as a maximized window.
SW_SHOWM INIMIZED
Activates the window and displays it as a minimized window.
SW SH OWM INNO ACTIYE