即当我按下Delphi的Ctrl+F9时执行我写的一段代码。

解决方案 »

  1.   

    将IDE的快捷键Ctrl+F9修改为运行你的代码
    运行完后再调用原来编译功能。
      

  2.   

    将IDE的快捷键Ctrl+F9修改为运行你的代码
    运行完后再调用原来编译功能。
    /////////
    这样也行???  我怎么没有想到。。
    /////
    呵呵。。
      

  3.   

    要执行什么代码?用Delphi Expert应该可以实现。
    表问我怎么做,我也不会……^_^
      

  4.   

    ToolsAPI
    IOTAEditActions.CompileProject参考
    http://access911.net/appraise.asp?recordid=72FAB11E16DCE7F3&type=aunit EagleBufferList; interface procedure Register; implementation uses Windows, Classes, SysUtils,Menus, ToolsAPI, Controls ; type 
      TBufferList = class(TNotifierObject, IUnknown, IOTANotifier, 
        IOTAKeyboardBinding)     
        function GetBindingType: TBindingType; 
        function GetDisplayName: string; 
        function GetName: string; 
        procedure BindKeyboard(const BindingServices: IOTAKeyBindingServices); 
      protected     
        procedure CodeCompletion(const Context: IOTAKeyContext; KeyCode: TShortcut; 
          var BindingResult: TKeyBindingResult); 
      end; 
       
    resourcestring 
      sBufferList = 'Eagle''s Buffer List';   //register this key binding 
    procedure Register; 
    begin 
      (BorlandIDEServices as IOTAKeyBoardServices).AddKeyboardBinding(TBufferList.Create);   
    end; { TBufferList } 
    //the code to bind key 
    procedure TBufferList.BindKeyboard(const BindingServices: IOTAKeyBindingServices); 
    begin 
      BindingServices.AddKeyBinding([ShortCut(Ord('P'), [ssShift, ssCtrl, ssAlt])], CodeCompletion, Pointer(csCodeList or csManual)); 
      BindingServices.AddKeyBinding([ShortCut(Ord('O'), [ssShift, ssCtrl, ssAlt])], CodeCompletion, Pointer(csParamList or csManual));   
    end; //do code completion 
    procedure TBufferList.CodeCompletion(const Context: IOTAKeyContext; 
      KeyCode: TShortcut; var BindingResult: TKeyBindingResult); 
    begin   (Context.EditBuffer.TopView as IOTAEditActions).CodeCompletion(Byte(Context.Context)); 
      BindingResult := krHandled; end; function TBufferList.GetBindingType: TBindingType; 
    begin 
      Result := btPartial; 
    end; function TBufferList.GetDisplayName: string; 
    begin 
      Result := sBufferList; 
    end; function TBufferList.GetName: string; 
    begin 
      Result := 'EagleKing.BufferList';  //do not localize 
    end; end.