Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

CWinApp::LoadIcon

Loads the icon resource named by lpszResourceName or specified by nIDResource from the executable file.

HICON LoadIcon( 
   LPCTSTR lpszResourceName  
) const; 
HICON LoadIcon( 
   UINT nIDResource  
) const;
lpszResourceName

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

nIDResource

ID number of the icon resource.

A handle to an icon if successful; otherwise NULL.

LoadIcon loads the icon only if it has not been previously loaded; otherwise, it retrieves a handle of the existing resource.

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

Note Note

This member function calls the Win32 API function LoadIcon, which can only load an icon whose size conforms to the SM_CXICON and SM_CYICON system metric values.

Header: afxwin.h

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.