CWinApp::LoadIcon

Syntax

HICON LoadIcon( LPSTR lpIconName );

HICON LoadIcon( UINT nIDIcon );

Parameters

lpIconName

Points to a null-terminated string that contains the name of the icon resource. You can also use a CString for this argument.

nIDIcon

ID number of the resource.

Remarks

Loads the icon resource named by lpIconName or specified by nIDIcon from the executable file. LoadIcon loads the icon only if it has not been previously loaded.

You can use the LoadStandardIcon or LoadOEMIcon member functions to access the predefined Windows icons.

Return Value

A handle to an icon resource. If unsuccessful, returns NULL.

See Also

CWinApp::LoadStandardIcon, CWinApp::LoadOEMIcon, ::LoadIcon