本人突然想知道可以不,谁知道啊~~~有的教教我!!!

解决方案 »

  1.   

    这个例子将一个菜单项加到系统菜单中去。我们需要两个东西,一个是项名,这可以是如何整数;我们还需要一个程序去收取Windows对确认点击我们创建的菜单项的信息。 Unit OhYeah; Interface Uses SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, Menus; Type TForm1 = Class (TForm) Procedure FormCreate (Sender : TObject); Private {Private declarations} 
    Public {Public declarations} Procedure WinMsg (Var Msg : TMsg; Var Handled : Boolean); 
    Procedure DoWhatEever; End; Var Form1 : TForm1; Implementation {$R *.DFM} Const ItemID = 99; // 这个ID number代表你的菜单项,可以是任何值。Procedure Tform1.WinMsg (Var Msg : TMsg; Var Handled : Boolean); Begin If Msg.Message = WM_SYSCOMMAND Then 
    If Msg.WParam = ItemID Then DoWhatEver; End; Procedure TForm1.FormCreate (Sender : TObject); Begin Application.OnMessage := WinMsg; 
    AppendMenu (GetSystemMenu (Form1.Handle, False), MF_SEPARATOR, 0, ''); 
    AppendMenu (GetSystemMenu (Form1.Handle, False), MF_BYPOSITION, ItemID, '&My menu'); 
    AppendMenu (GetSystemMenu (Application.Handle, False), MF_SEPARATOR, 0, ''); 
    AppendMenu (GetSystemMenu (Application.Handle, False), MF_BYPOSITION, ItemID,'&My menu minimized'); End; Procedure TForm1.DoWhatEver; Begin Exit; //你可以添加任何你想加的东西到这里
    End; End.
      

  2.   

    add an item to the systemmenu ? unit Unit1;  interface  uses  
      Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,  
      StdCtrls, Buttons;  type  
      TForm1 = class(TForm)  
        BitBtn1: TBitBtn;  
        procedure FormCreate(Sender: TObject);  
      private  
        procedure WMSysCommand(VAR Message: TWMSysCommand); message WM_SYSCOMMAND;  
        { Private-Deklarationen }  
      public  
        { Public-Deklarationen }  
      end;  var  
      Form1: TForm1;  implementation  
       uses Unit2;  {$R *.DFM}  procedure TForm1.WMSysCommand(var Message: TWMSysCommand);  
    begin  
      Inherited;  
      IF Message.CmdType = $F200  THEN form2.showmodal  
    end;  procedure TForm1.FormCreate(Sender: TObject);  
    var s : string;  
    begin  
      s := '&Copyright...';  
      AppendMenu(GetSystemMenu(Handle, False), MF_STRING, $F200, PChar(s));  
    end;  end.