unit UnitFrmMenu;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TFrmMenu = class(TForm)
    Label3: TLabel;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Label1MouseEnter(Sender: TObject);
    procedure Label1MouseLeave(Sender: TObject);
    procedure Label2Click(Sender: TObject);
    procedure Label3Click(Sender: TObject);
    procedure Label1Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
    procedure show;
    procedure Close;
  end;

var
  FrmMenu: TFrmMenu;

implementation

uses UnitPopupGenerate;

{$R *.dfm}

procedure TFrmMenu.Button1Click(Sender: TObject);
begin
    showmessage('BUTTON');
end;

procedure TFrmMenu.Close;
begin
 ShowWindow(Handle, SW_HIDE);
end;

procedure TFrmMenu.FormCreate(Sender: TObject);
begin
    SetWindowLong(
        Handle,
     GWL_STYLE,
     GetWindowLong( Handle, GWL_STYLE ) and not WS_CAPTION
    ) ;
    ClientHeight := Height;
end;

procedure TFrmMenu.Label1Click(Sender: TObject);
begin
    self.close;
end;

procedure TFrmMenu.Label1MouseEnter(Sender: TObject);
begin
    TLabel(sender).Color := clHighlight;
end;

procedure TFrmMenu.Label1MouseLeave(Sender: TObject);
begin
    TLabel(sender).Color := clBtnFace;
end;

procedure TFrmMenu.Label2Click(Sender: TObject);
begin
    self.close;
end;

procedure TFrmMenu.Label3Click(Sender: TObject);
begin
    showmessage('click');
    self.close;
end;

procedure TFrmMenu.show;
begin

    //frmmenu.ParentWindow := 0;
    //self.Invalidate;
    Button1.Repaint;
    SetWindowPos(Handle, HWND_DESKTOP, self.Left, self.Top, self.Width, self.Height,
      SWP_NOACTIVATE);

    ShowWindow(Handle, SW_SHOWNOACTIVATE);
end;

end.
