procedure TForm1.FormCreate(Sender: TObject);
var
hSysMenu: integer;
begin
hSysMenu := GetSystemMenu(Application.Handle, false);
DeleteMenu(hSysMenu, 3, MF_BYPOSITION);
DeleteMenu(hSysMenu, 2, MF_BYPOSITION);
DeleteMenu(hSysMenu, 1, MF_BYPOSITION);
DeleteMenu(hSysMenu, 0, MF_BYPOSITION);
InsertMenu(hSysMenu, 0, MF_BYPOSITION, SC_ABOUT, Pchar('About')); //如何响应该菜单俺不懂
end;
var
hSysMenu: integer;
begin
hSysMenu := GetSystemMenu(Application.Handle, false);
DeleteMenu(hSysMenu, 3, MF_BYPOSITION);
DeleteMenu(hSysMenu, 2, MF_BYPOSITION);
DeleteMenu(hSysMenu, 1, MF_BYPOSITION);
DeleteMenu(hSysMenu, 0, MF_BYPOSITION);
InsertMenu(hSysMenu, 0, MF_BYPOSITION, SC_ABOUT, Pchar('About')); //如何响应该菜单俺不懂
end;
解决方案 »
- 如何调用过程啊?
- delphi 高手来指点一下!
- delphi 单击form 中的按钮 button2 实现窗口关闭,如下代码 怎么老是报错 ?
- 关于TDateTimePicker的一个问题,加急,准时上分
- 巨难SQL语句请教。。。。。
- 谁能够给一个client向server 传输文件的例子:
- query.recordcount 总是为-1,请教!
- 如何让TOOLBAR透明显示?
- 在delphi数据库编程过程中, 如何使用cursor?有范例最好, 谢谢
- 关于NT服务器程序
- 请问table1.FieldByName('company').AsString:=edit1.Text;里的AsString是干嘛的,它是怎么用的呀?
- 为什么,帖子不能提前
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
procedure wmSysCommand(var msg:TMessage); message WM_SYSCOMMAND;
public
{ Public declarations }
end;
var
Form1: TForm1;
const
ID_ABOUT = WM_USER+1;
ID_HELP = WM_USER+2;
ID_NEWLINE = WM_USER+4;
implementation
{$R *.DFM}
procedure TForm1.FormCreate(Sender: TObject);
var
SysMenu:THandle;
begin
SysMenu := GetSystemMenu(Handle,False);
InsertMenu(SysMenu,Word(-1),MF_SEPARATOR,ID_NEWLINE,'');
InsertMenu(SysMenu,Word(-1),MF_BYPOSITION,ID_HELP, '帮助');
InsertMenu(SysMenu,Word(-1),MF_BYPOSITION,ID_ABOUT, '关于...');
end;
///下面部分是响应相应的菜单的事件的!
procedure TForm1.wmSysCommand;
begin
case Msg.wParam of
ID_ABOUT : ShowMessage('想知道什么?');
ID_HELP : ShowMessage('不会不懂吧,确实有点难度的!');
end;
inherited;
end;
end.