VCL Delphi

Title: How to Close / Hide a TPopupMenu
procedure HidePopupMenu;
begin
PostMessage(Handle, WM_LBUTTONDOWN, MK_LBUTTON, 0);
PostMessage(Handle, WM_LBUTTONUP, MK_LBUTTON, 0);
end;