How do I dynamically create an icon to display in the system tray?
-
I'm pulling my hair out over this one!:mad: I am trying to dynamically create an icon to display in the system tray. This icon acts like a mini-graph so I don't want to pre-create all possible icons. I have a template icon resource that I want to use as a base. I have used GetIconInfo to retreive the icon's HBITMAP handles for the mask and color bitmaps. However, from here I don't know how I should get an appropriate DC to select the bitmap into. Any suggestions? Kelly Herald Software Developer MPC
-
I'm pulling my hair out over this one!:mad: I am trying to dynamically create an icon to display in the system tray. This icon acts like a mini-graph so I don't want to pre-create all possible icons. I have a template icon resource that I want to use as a base. I have used GetIconInfo to retreive the icon's HBITMAP handles for the mask and color bitmaps. However, from here I don't know how I should get an appropriate DC to select the bitmap into. Any suggestions? Kelly Herald Software Developer MPC
Can you use the CreateIconIndirect API? It has a ICONINFO param which take HBITMAP as structur members. I think you can paint the bitmap and then create an icon form it. The bitmap could be selected in a memory dc (use CreateCompatibleDC), then drawing can be done
-
Can you use the CreateIconIndirect API? It has a ICONINFO param which take HBITMAP as structur members. I think you can paint the bitmap and then create an icon form it. The bitmap could be selected in a memory dc (use CreateCompatibleDC), then drawing can be done
I finally got it working. What I hadn't done was use the CreateCompatibleDC method. Thank you. Kelly Herald Software Developer MPC