Shell32PickIconDlg(IntPtr, StringBuilder, Int32, Int32) Method

Displays a dialog box that allows the user to choose an icon from the selection available embedded in a resource such as an executable or DLL file.

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("Shell32.dll", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static bool PickIconDlg(
	IntPtr hWnd,
	StringBuilder iconPath,
	int iconPathSize,
	ref int refIconIndex
)

Parameters

hWnd  IntPtr
The handle of the parent window. This value can be Zero.
iconPath  StringBuilder
A pointer to a string that contains the null-terminated, fully qualified path of the default resource that contains the icons.

If the user chooses a different resource in the dialog, this buffer contains the path of that file when the function returns.

This buffer should be at least MAX_PATH characters in length, or the returned path may be truncated.

You should verify that the path is valid before using it.

iconPathSize  Int32
The number of characters in iconPath, including the terminating NULL character.
refIconIndex  Int32
A pointer to an integer that on entry specifies the index of the initial selection and, when this function returns successfully, receives the index of the icon that was selected.

Return Value

Boolean
Returns if successful; otherwise, .

Remarks

See Also