我在系统栏中做了一个图标,右键弹出菜单,弹出后如果我不想使用菜单怎么才能让我点一下桌面或其它程序就可以让菜单消失??
 右键弹出菜单使用的程序如下 :procedure TForm1.mousemessage(var message: tmessage);
var
mousept: TPoint; //鼠标点击位置
begin
  inherited;
  if message.LParam = wm_rbuttonup then begin //用鼠标右键点击图标
    getcursorpos(mousept); //获取光标位置
    popupmenu1.popup(mousept.x, mousept.y);
    //在光标位置弹出选单
  end;
  if message.LParam = wm_lbuttonup then begin //用鼠标左键点击图标
    //显示应用程序窗口
    ShowWindow(Handle, SW_SHOW);
    //在任务栏上显示应用程序窗口
    ShowWindow(Application.handle, SW_SHOW);
    SetWindowLong(Application.Handle, GWL_EXSTYLE,
    not (GetWindowLong(Application.handle, GWL_EXSTYLE)
    or WS_EX_TOOLWINDOW AND NOT WS_EX_APPWINDOW));
    form1.Show;
  end;
  message.Result := 0;
end;