Shell32FindExecutable Method
Retrieves the name of and handle to the executable (.exe) file associated with a specific document file.
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("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
public static IntPtr FindExecutable(
string file,
string directory,
StringBuilder result
)
<DllImportAttribute("Shell32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true>]
Public Shared Function FindExecutable (
file As String,
directory As String,
result As StringBuilder
) As IntPtr
Dim file As String
Dim directory As String
Dim result As StringBuilder
Dim returnValue As IntPtr
returnValue = Shell32.FindExecutable(file,
directory, result)
public:
[DllImportAttribute(L"Shell32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)]
static IntPtr FindExecutable(
String^ file,
String^ directory,
StringBuilder^ result
)
[<DllImportAttribute("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true)>]
static member FindExecutable :
file : string *
directory : string *
result : StringBuilder -> IntPtr
No code example is currently available or this language may not be supported.
- file String
-
A null-terminated string that specifies a file name. This file should be a document.
- directory String
-
A null-terminated string that specifies the default directory. This value can be .
- result StringBuilder
-
The address of a buffer that receives the file name of the associated executable file.
This file name is a null-terminated string that specifies the executable file started when
an "open" by association is run on the file specified in the lpFile parameter.
Put simply, this is the application that is launched when the document file is directly double-clicked
or when Open is chosen from the file's shortcut menu.
This parameter must contain a valid non-null value and is assumed to be of length MAX_PATH.
Responsibility for validating the value is left to the programmer.
IntPtr
Returns a value greater than 32 if successful, or a value less than or equal to 32 representing an error.