procedure appendtosystemmenu(form,tform;item:string;itemid:word);
var normalsysmenu,minimizedmenu:hmenu;
aitem:array[0..255]of char;
pitem
char;
begin
normalsysmenu:=getsystemmenu(form.handle,false);
minimizedmenu:=getsystemmenu(application.handle,false);
if item='-' then
begin
appendmenu(normalsysmenu,mf_separator,0,nil);
appendmenu(minimizedmenu,mf_separator,0,nil);
end else
begin
fitem:=strcopy(@aitem,item);
appendmenu(normalsysmenu,mf_string,itemid,pitem);
appendmenu(minimizedmenu,mf_string,itemid,pitem);
end;
使用
appendtosystemmenu(mainform,'-',0);
appendtosystemmenu(mainform,'&r注册',99);
application.onmessage:=mainform.registermsg;
procedure tmainform.registermsg(var msg:tmsg;var handled:boolean);
begin
if msg.message=wm_syscommand then
if msg.wparam=99 then
//自己的代码
你试 一下,抄的,不会