如何在Delphi中查找并关闭弹出菜单? [英] How to find and close popup menu in Delphi?

查看:81
本文介绍了如何在Delphi中查找并关闭弹出菜单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Delphi中有一个MDI win32应用程序.它具有多种形式,所有形式及其内部组件都有自己的弹出菜单.

I've got an MDI win32 application in Delphi. It has many forms, all of them and their inner components have own popup menus.

一段时间后,当应用程序空闲时,触发器将启动并关闭所有子窗口.但是,如果显示,它不会关闭弹出菜单.(例如,用户单击右键并离开计算机-触发器启动时也应关闭弹出菜单.)

After some time when application idles trigger starts and it closes all child windows. But it doesn't close popup menu if it is showing. (For example user clickes right button and leaved computer -the popup menu should be closed also when trigger starts.)

GetWindow函数找不到弹出菜单.

GetWindow function doesn't find the popup menu.

如何找到弹出菜单并关闭它?

How to find the popup menu and close it?

推荐答案

SendMessage(PopupList.Window, WM_CANCELMODE, 0, 0);

全局 Menus.PopupList 对象管理用于处理应用程序中VCL弹出菜单的所有消息的窗口.

The global Menus.PopupList object manages the window that handles all messages for VCL popup menus in the application.

这篇关于如何在Delphi中查找并关闭弹出菜单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆