I am following the CodeCentral article on how to extend the project menu in Delphi IDE, using IOTAProjectManager.
The sample wizard code on code-central does this:
procedure Register;
begin
FNotifierIndex := (BorlandIDEServices as IOTAProjectManager).AddMenuCreatorNotifier(TMyContextMenu.Create); // deprecated.
end;
What is the new technique to register a context menu such as the project menu one? Note that this was deprecated without even making it onto the docwiki.
Screenshot of desired result:
Update: I could not find any up to date tutorials including code. There is a PDF whitepaper on Embarcadero's website but the code samples from that whitepaper by Bruno Fierens are not anywhere on the web. I made an answer below with a working example, which is on bitbucket, you can download the zip below.
If you look at the source code in
$(BDS)\Source\ToolsAPI\ToolsAPI.pas
, the declaration ofIOTAProjectManager.AddMenuCreatorNotifier()
says:And also, the declaration of
INTAProjectMenuCreatorNotifier
says:Here are the relevant declarations and descriptions. Note the comments: