oder einen WMMENUSELECT Handler schreiben:
Delphi-Quellcode:
private
{ Private declarations }
procedure WMMENUSELECT(var Message: TWMMENUSELECT); message WM_MENUSELECT;
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.WMMENUSELECT(var message: TWMMENUSELECT);
var
IsMenuOpen: Boolean;
begin
inherited;
IsMenuOpen := not (message.MenuFlag and $FFFF = 0) and (message.Menu = MainMenu1.Handle);
if IsMenuOpen then
begin
// Mainmenü geöffnet
end;
end;