Kernel32WinExec Method
Note: This API is now obsolete.
Namespace: DevCase.Win32.NativeMethodsAssembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ExactSpelling = true, ThrowOnUnmappableChar = true)]
[ObsoleteAttribute("Note: This function is provided only for compatibility with 16-bit Windows. Applications should use the 'CreateProcess' function.",
false)]
public static uint WinExec(
string cmdLine,
NativeWindowState cmdShow
)
<DllImportAttribute("Kernel32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ExactSpelling := true, ThrowOnUnmappableChar := true>]
<ObsoleteAttribute("Note: This function is provided only for compatibility with 16-bit Windows. Applications should use the 'CreateProcess' function.",
false)>
Public Shared Function WinExec (
cmdLine As String,
cmdShow As NativeWindowState
) As UInteger
Dim cmdLine As String
Dim cmdShow As NativeWindowState
Dim returnValue As UInteger
returnValue = Kernel32.WinExec(cmdLine,
cmdShow)
public:
[DllImportAttribute(L"Kernel32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ExactSpelling = true, ThrowOnUnmappableChar = true)]
[ObsoleteAttribute(L"Note: This function is provided only for compatibility with 16-bit Windows. Applications should use the 'CreateProcess' function.",
false)]
static unsigned int WinExec(
[InAttribute] String^ cmdLine,
NativeWindowState cmdShow
)
[<DllImportAttribute("Kernel32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ExactSpelling = true, ThrowOnUnmappableChar = true)>]
[<ObsoleteAttribute("Note: This function is provided only for compatibility with 16-bit Windows. Applications should use the 'CreateProcess' function.",
false)>]
static member WinExec :
cmdLine : string *
cmdShow : NativeWindowState -> uint32
No code example is currently available or this language may not be supported.
- cmdLine String
-
The command line (file name plus optional parameters) for the application 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 sequence:
1. The directory from which the application loaded.
2. The current directory.
3. The Windows system directory. The GetSystemDirectory function retrieves the path of this directory.
4. The Windows directory. The GetWindowsDirectory function retrieves the path of this directory.
5. The directories listed in the PATH environment variable.
- cmdShow NativeWindowState
-
The display options.
UInt32
If the function succeeds, the return value is greater than 31.
If the function fails, the return value is one of the following error values:
0 (zero): The system is out of memory or resources.
ERROR_BAD_FORMATERROR_FILE_NOT_FOUNDERROR_PATH_NOT_FOUND