Currently viewing: GipsySoft » Front Page» Articles


Sets both large and small icons for a window.

If you don't explicitly set the 16x16 icon Windows will shrink your 32x32 icon - this almost always leads to an ugly small icon for your window.

Can be used on main windows and dialog boxes.

bool SetWindowIcon( HWND hwnd, UINT uID );

Return value

Returns true if loading and settig the icons is successful.


SetWindowIcon( hwnd, IDI_MAIN );


Click to view the source code

See also none