Kernel32FindResource(SafeModuleHandle, String, ResourceType) Method

Determines the location of a resource with the specified type and name in the specified module.

To specify a language of the resource, use the FindResourceEx(SafeModuleHandle, ResourceType, IntPtr, UInt16) function.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: 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, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr FindResource(
	SafeModuleHandle hModule,
	string resourceName,
	ResourceType resourceType
)

Parameters

hModule  SafeModuleHandle
A handle to the module whose portable executable file or an accompanying MUI file contains the resource.

If this parameter is , the function searches the module used to create the current process.

resourceName  String
The name of the resource.
resourceType  ResourceType
The resource type.

Return Value

IntPtr
If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this handle to the LoadResource(SafeModuleHandle, IntPtr) function.

If the function fails, the return value is Zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also