How can i set icon to the menu items?

Uwill

Member
For example:
ScreenShot

I'm trying to write a plugin, I found that some users can set icon to the menu item ,but there are no reference about this in the ,can any tell me how to do ?

And more,I found that the document is out of date,'PChar' can not be used in Delphi XE and higher version, but should be 'PAnsiChar', or the plugin will not work properly,this should be mentioned.
 
From the documentation:
150 IDE_CreateToolButton
Available in version 510
C++ void IDE_CreateToolButton(int ID, int Index, char *Name
char *BitmapFile, int BitmapHandle)
Delphi procedure IDE_CreateToolButton(ID, Index: Integer;
Name: PChar; BitmapFile: PChar;
BitmapHandle: Integer)
This function allows you to add Toolbuttons to your Plug-In, similar to
IDE_CreatePopupItem. The ID is the Plug-In ID and the index is the
menu index. When a button is selected, OnMenuClick is called with the
corresponding index.
The Name will appear as hint for the button, and as name in the
preferences dialog.
The button can be enabled and disabled with IDE_MenuState.
The image for the button can be set by passing a filename to a bmp file
in the BitmapFile parameter, or as a handle to a bitmap in memory.
The bmp image can have any number of colors, but should
approximately be 20 x 20 pixels in size.
The button will only be visible if it is selected in the Toolbar preference.

Kindest regards,
Patrick 'ACE' Barel
 
patch:
Thanks for you reply,but it can not help me.
Because I can see icons on toolbar,but not on popup menu.
My code is like this:
1 : begin
Name := 'Commnet Lines';
BitmapHandle := LoadBitmap(HInstance,'ImgCommnet');
IDE_CreateToolButton(PlugInID, Index, Name, nil, BitmapHandle);
end;
Can any one help me ?
 
Back
Top