G
gaodu2002
Unregistered / Unconfirmed
GUEST, unregistred user!
大家好,我想把系统菜单做为程序中的一个弹出菜单来用,但问题是取得的菜单项不能实现系统菜单所对应的功能,请帮忙解决一下:
var
Form1: TForm1;
sysmn: hmenu;
implementation
{$R *.DFM}
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight then
begin
trackpopupmenu(sysmn, tpm_rightbutton, mouse.CursorPos.X, mouse.CursorPos.Y, 0, handle, nil);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
sysmn := getsystemmenu(handle, false);
end;
var
Form1: TForm1;
sysmn: hmenu;
implementation
{$R *.DFM}
procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Button = mbRight then
begin
trackpopupmenu(sysmn, tpm_rightbutton, mouse.CursorPos.X, mouse.CursorPos.Y, 0, handle, nil);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
sysmn := getsystemmenu(handle, false);
end;