Hi Joesph,
The ToolBox bitmap resource is specified in the regsitry key:
HKCR\CLSID\{CLSID of the control}\ToolBoxBitmap32\
(see the RegisterControl method in ActiveXCtrlHelper)
ToolBoxBitmap32 is used to identify the module name and the resource ID for a
16 x 16 bitmap as the toolbar button face. Each specified icon must be
embedded as a win32 resource in the assembly. In order to embed the bitmap
CSActiveX.bmp into the assembly as a win32 resource, we need to
Step1. Place the CSActiveX.bmp file in the root folder of the project.
Step2. Add a .rc file (CSActiveX.rc) to the project with the content:
101 BITMAP CSActiveX.bmp
101 is the resource ID, BITMAP is the resource type, and CSActiveX.bmp is the
resource name.
You can use
classID to search in Registry to see this registry value in ToolBoxBitmap32 at the registry. When I change the value in registry with one existing icon file, it is changed in ToolBox in VB6( although it is not my expected result, it is one whole black plank). Based on this result, changing the embedded resource is one method to implement your requirement.
Best regards,
Riquel
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.