Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get the dimensions of an Icon from its handle?

I have a handle to the icon (HICON) and have to find out the dimensions of the icon that it represents. How do I get this information?

like image 681
Canopus Avatar asked Dec 04 '25 17:12

Canopus


1 Answers

Pass it to GetIconInfo() then pass either the returned colour or mask HBITMAP to GetObject() to get a BITMAP struct that has height/width members.

like image 116
Alex K. Avatar answered Dec 07 '25 15:12

Alex K.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!