在系统菜单中实现加入新菜单功能

源代码在线查看: dy219.pas

软件大小: 172 K
上传用户: LIBIN200788
关键词: 菜单
下载地址: 免注册下载 普通下载 VIP

相关代码

				unit dy219;
				
				interface
				
				uses
				  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
				  Dialogs;
				
				type
				  TForm1 = class(TForm)
				    procedure FormCreate(Sender: TObject);
				  private
				    procedure sysmenu(var msg: twmmenuselect);message wm_syscommand;
				    { Private declarations }
				  public
				    { Public declarations }
				  end;
				
				var
				  Form1: TForm1;
				
				implementation
				
				{$R *.dfm}
				
				procedure TForm1.FormCreate(Sender: TObject);
				var
				  i: integer;
				begin
				  i := getsystemmenu(handle,false);
				  appendmenu(i,mf_separator,0,nil);
				  appendmenu(i,mf_string,100,'我的菜单(&E)');
				
				end;
				
				procedure TForm1.sysmenu(var msg: twmmenuselect);
				begin
				  if msg.IDItem = 100 then
				    showmessage('您选择了自己添加的菜单!')
				  else
				    inherited;
				end;
				
				end.
							

相关资源