<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
<span>static BOOL get_icon_size( HICON handle, SIZE *size )<br>
</span>
<div>{<br>
</div>
<div>    ICONINFO info;<br>
</div>
<div>    BITMAP bmp;<br>
</div>
<div>    int ret;<br>
</div>
<div><br>
</div>
<div>    if (!GetIconInfo(handle, &info))<br>
</div>
<div>        return FALSE;<br>
</div>
<div><br>
</div>
<div>    ret = GetObjectW(info.hbmMask, sizeof(bmp), &bmp);<br>
</div>
<div>    if (ret)<br>
</div>
<div>    {<br>
</div>
<div>        size->cx = bmp.bmWidth;<br>
</div>
<div>        size->cy = bmp.bmHeight;<br>
</div>
<div>        /*<br>
</div>
<div>            If this structure defines a black and white icon, this bitmask is formatted
<br>
</div>
<div>            so that the upper half is the icon AND bitmask and the lower half is
<br>
</div>
<div>            the icon XOR bitmask. <br>
</div>
<div>        */<br>
</div>
<div>        if (!info.hbmColor)<br>
</div>
<div>            size->cy /= 2;<br>
</div>
<div>    }</div>
<div><br>
</div>
<div>
<p>GetIconInfo() fill info.hbmColor with NULL HBITMAP handle on black/white bitmaps</p>
<p></p>
<br>
</div>
<div><br>
</div>
<div>    DeleteObject(info.hbmMask);<br>
</div>
<div>    DeleteObject(info.hbmColor);<br>
</div>
<div><br>
</div>
<div>    return !!ret;<br>
</div>
<span>}</span><br>
</div>
</body>
</html>