DrawIcon

Syntax

BOOL DrawIcon(hDC,X,Y,hIcon)

This function draws an icon on the specified device. The DrawIcon function places the icon's upper-left corner at the location specified by the X and Y parameters. The location is subject to the current mapping mode of the device context.

Parameter Type/Description  
hDC HDC Identifies the device context for a window.  
X int Specifies the logical x-coordinate of the upper-left corner of the icon.  
Y int Specifies the logical y-coordinate of the upper-left corner of the icon.  
hIcon HICON Identifies the icon to be drawn.  

Return Value

The return value specifies the outcome of the function. It is nonzero if the function is successful. Otherwise, it is zero.

Comments

The icon resource must have been previously loaded by using the LoadIcon function. The MM_TEXT mapping mode must be selected prior to using this function.