AddMenuItem
(IE5Tools)
Function
AddMenuItem(ConnType: TconnType; MenuText,
StatusBarText, GuidOrPath: string; HelpMenu: Boolean):
string;
|
Parameters:
-
ConnType
Can have one of following values:
COM_OBJECT if the item implements a
Com-object.
The COM object must implement
IOleCommandTarget. If your COM object needs to access
the DHTML Object Model of the page that Internet
Explorer is looking at, you must implement
IObjectWithSite.
The implementations of IOleCommandTarget's
methods are standard, except for IoleCommandTarget.Exec.
The COM object's IOleCommandTarget.Exec method is
called with nCmdID=0 if the toolbar button or
menu item is clicked. This difference allows developers
to provide different behaviors for the toolbar button
and the menu item.
When IObjectWithSite is implemented, Internet
Explorer will call IOleObjectWithSite.SetSite and pass
it a pointer to IShellBrowser.
EXECUTABLE if the item runs an .exe-file.
SCRIPT if the item runs a script-file.
MenuText
Set the value of MenuText to the text you want
to be displayed in the Tools menu.
This text does not support any
underlining of characters for shortcut keys, because there
is no way to prevent conflicts.
StatusBarText
Set the value of MenuStatusBar to the text you
want displayed in the status bar when the menu item is
highlighted. This text should describe what the script
associated with this menu item will do.
GuidOrPath
If ConnType is COM_OBJECT: Set the value
equal to the GUID of the COM object.
If ConnType is EXECUTABLE or SCRIPT: Set the value
to the full path to the executable file or to the script.
HelpMenu
TRUE to add the item to Help menu.
FALSE to add the item to Tools menu.
Use RemoveMenuItem(MenuText)
to the remove the menuitem from IE5 and Registry.
Links:
Adding
Menu Items
|