Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 152
  • Last Modified:

Extracting Windows Icon Image

Hello Experts,
I have a function in C++ which gets the window ICON.
that is using WM_GETICON and CopyImage.
But copy Image returns handle. If I need to get that bitmap Image of the Icon, How do I go about it ?
(to save in a .ico file)

Pls help
Thanks in advance


Anjali
0
anjalidevi
Asked:
anjalidevi
2 Solutions
 
ziolkoCommented:
var icon: TIcon;


icon:=TIcon.Create;
icon.Handle:=youriconhadle
icon.SavetoFile(filename)
icon.Free;


ziolko.
0
 
krukmatCommented:
Did you try with API call: BitBlt? You can specify the source handle(Icon Handle), and destination handle(aBitmap handle). You must use the ROP option SRCCOPY.
After using it the only thing u sholud do is TBitmap method SaveToFile(...)
For more info about BitBlt, read Win32 SDK Help.
0
 
CleanupPingCommented:
anjalidevi:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
kacorretiredCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area for this question:
       to split points between ziolko and krukmat
Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Some days and here is the Christmas Time. I wish good luck and good health for you all and for your loved ones

kacor
EE Cleanup Volunteer
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now