Mega Code Archive

 
Categories / Delphi / Ide Indy
 

Delphi IDE

Title: Delphi IDE Question: How to hack delphi environment (IDE)? Answer: This is just a sample application for interacting with Delphi IDE.U can use it more extensively. For invoking other applications u just need to change the menuclick event handler. Given below is the full code. Compile this unit into a package and install the same. unit SubhaExp; interface uses Windows,Menus,ExtCtrls,SysUtils,Forms,ToolsApi; Type TSubhaMenu = Class Private FMainMenu : TMainMenu; FFileMenu : TMenuItem; FGiriMenu : TMenuItem; Procedure OnMenuItemClick(Sender : TObject); Public Procedure AddMenuItem; Procedure RemoveMenuItem; End; Var FSubhaMenu : TSubhaMenu; Procedure Register; implementation Procedure TSubhaMenu.AddMenuItem; Var i : Integer; Begin FMainMenu := (BorlandIDEServices As INTAServices).MainMenu; For i := 0 to FMainMenu.Items.Count - 1 Do Begin If AnsiSameCaption(FmainMenu.items[i].Caption, 'File') Then Begin FFileMenu := FMainMenu.items[i]; Break; End; End; FGiriMenu := TMenuItem.Create(FFileMenu); FGiriMenu.Caption := 'Subha IDE Services'; FGiriMenu.OnClick := OnMenuItemClick; For i := 0 to FFileMenu.count - 1 Do Begin If FFileMenu.Items[i].isLine Then Begin FFileMenu.Insert(i,FGiriMenu); Break; End; End; End; Procedure TSubhaMenu.RemoveMenuItem; Var i : Integer; Begin For i := 0 to FFileMenu.Count - 1 Do Begin If AnsiSameCaption(FFileMenu.Items[i].Caption,'Subha IDE Services') Then Begin FFileMenu.Remove(FFileMenu.items[i]); Break; End; End; End; Procedure TSubhaMenu.OnMenuItemClick(Sender : TObject); Begin Application.MessageBox(PChar('This Is only a Simple Example' + ' to Work With Delphi IDE ' + #13#10 + ' For Further Details On This Contact' + #13#10#13#10 + ' subha_n5@hotmail.com'),PChar('Message From Subha'),MB_OK); End; Procedure Register; Begin FSubhaMenu.AddMenuItem; Application.MessageBox('Subha Narayanan Has Hacked Your ' + ' Delphi Environment !!! ' + #13#10 + ' See You Soon With Lot More Goodies !!! ' + #13#10 + ' CopyRight (c) 2001, Subha Narayanan. ', ' Welcome To Delphi ',MB_SYSTEMMODAL); End; Initialization FSubhaMenu := TSubhaMenu.Create; Finalization FSubhaMenu.RemoveMenuItem; FSubhaMenu.Free; end.