DrawIcon

2.x

  BOOL DrawIcon(hdc, x, y, hicon)    
  HDC hdc; /* handle of device context */
  int x; /* x-coordinate of upper-left corner */
  int y; /* y-coordinate of upper-left corner */
  HICON hicon; /* handle of icon to draw */

The DrawIcon function draws an icon on the given device. The DrawIcon function places the icon's upper-left corner at the specified location.

Parameters

hdc

Identifies the device context for a window.

x

Specifies the logical x-coordinate of the upper-left corner of the icon.

y

Specifies the logical y-coordinate of the upper-left corner of the icon.

hicon

Identifies the icon to be drawn.

Return Value

The return value is nonzero if the function is successful. Otherwise, it is zero.

Comments

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

See Also

GetMapMode, LoadIcon, SetMapMode