使用实时弹出菜单最小化 Delphi 应用程序
我正在尝试在计时器中运行它:
Application.Minimize;
ShowWindow( Application.handle, SW_HIDE );
它一直在代码中,我们刚刚发现当您有一个弹出菜单处于活动状态时它不起作用,它不会最小化 MDI 父窗口。
我想如果我可以在运行此代码之前关闭弹出菜单,那么我就可以了。问题是,这段代码位于 MDI 父级中,我不知道当前弹出菜单在哪里。无论它是另一个表单工具栏的一部分、这个表单工具栏、右键单击的结果还是空格键旁边看似毫无意义的键的一部分,都没关系。
那么,有没有办法隐藏整个程序中的活动弹出菜单?
另外,如果有比我用来最小化的更好的代码块来规避这个问题,那也是很棒的信息。
I'm attempting to run this in a timer:
Application.Minimize;
ShowWindow( Application.handle, SW_HIDE );
It's been in the code forever and we just discovered that it doesn't work when you have a popupmenu active, it doesn't minimize the MDI parent window.
I figure if I can close the popup menu before running this code, then I'll be ok. Problem is, this code is in an MDI Parent and I have no idea where the current popup menu is. It doesn't matter if it's part of another form's tool bar, this forms tool bar, the product of a right click or that seemingly pointless key next to the space bar.
So, is there a way to hide the active popup menu in my entire program?
Also, if there's a better hunk of code than what I'm using to minimize that'll circumvent this issue, that'd be awesome info too.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要关闭弹出菜单,您可以
在尝试最小化表单之前在代码中使用。
To close a popup menu you can use
in your code before you try to minimize the form.