新建个package包,再建个unit文件,使用以下代码,编译安装,菜单就出现在delphi的IDE菜单了。
继承自TNotifierObject,没有继承自IOTAWizard,所以没有调用RegisterPackageWizard进行注册
unit MyWizard1;
interface
procedure Register;
implementation
uses Windows,Classes,SysUtils,ToolsAPI,Menus,Registry, Unit1CCNato;
type TMywizardIdeMenu = class(TNotifierObject)
private
class procedure OnViewComponentMenuClick(Sender: TObject);
public
class procedure CreateMenus;
end;
function GetActiveProjectGroup:IOTAProjectGroup;
var
I:Integer;
begin
Result := nil;
with BorlandIDEServices as IOTAModuleServices do
for I:=0 to ModuleCount -1 do
if Supports(Modules[I],IOTAProjectGroup,Result) then Exit;
end;
function GetActiveProject:IOTAProject;
var
ProjectGroup:IOTAProje