Skip to content

ShowPickIconDialog function

FireBlade edited this page Aug 25, 2025 · 3 revisions

ShowPickIconDialog function

Wraps: PickIconDlg

ShowPickIconDialog(nint hWnd, string defIconPath, int defIconIndex, out string iconPath, out int iconIndex)

Displays a modal 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.

Parameters

nint hWnd

The handle of the parent window.

string defIconPath

A string that contains the fully qualified path of the default resource that contains the icons. You should verify that the path is valid before using it.

int defIconIndex

An integer that specifies the index of the initial selection.

out string iconPath

If the user chooses a different resource in the dialog, contains the path of that file when the function returns; otherwise, it contains the path stored in defIconPath.

out int iconIndex

When this function returns successfully, receives the index of the icon that was selected.

Returns

true if successful; otherwise, false.

ShowPickIconDialog(string defIconPath, int defIconIndex, out string iconPath, out int iconIndex)

Displays a modeless 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.

Parameters

string defIconPath

A string that contains the fully qualified path of the default resource that contains the icons. You should verify that the path is valid before using it.

int defIconIndex

An integer that specifies the index of the initial selection.

out string iconPath

If the user chooses a different resource in the dialog, contains the path of that file when the function returns; otherwise, it contains the path stored in defIconPath.

out int iconIndex

When this function returns successfully, receives the index of the icon that was selected.

Returns

true if successful; otherwise, false.

ShowPickIconDialog(nint hWnd, string defIconPath, int defIconIndex, out Icon icon)

Displays a modal 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.

Parameters

nint hWnd

The handle of the parent window.

string defIconPath

A string that contains the fully qualified path of the default resource that contains the icons. You should verify that the path is valid before using it.

int defIconIndex

An integer that specifies the index of the initial selection.

out Icon icon

When this function returns, contains the Icon that was selected. If loading the icon fails, contains SystemIcons.Error.

Returns

true if successful; otherwise, false.

ShowPickIconDialog(string defIconPath, int defIconIndex, out Icon icon)

Displays a modeless 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.

Parameters

string defIconPath

A string that contains the fully qualified path of the default resource that contains the icons. You should verify that the path is valid before using it.

int defIconIndex

An integer that specifies the index of the initial selection.

out Icon icon

When this function returns, contains the Icon that was selected. If loading the icon fails, contains SystemIcons.Error.

Returns

true if successful; otherwise, false.

Clone this wiki locally