简体   繁体   English

防止MessageBox最小化其他窗口

[英]Prevent MessageBox from minimizing other windows

In my project I have a MessageBox that pops up from time to time. 在我的项目中,我会不时弹出一个MessageBox。

When I'm playing a game and the MessageBox appears, the game is minimized and I'm back to the desktop. 当我在玩游戏并出现MessageBox时,游戏被最小化,然后我回到桌面上。 This might depend from app to app, but this specific app/game minimizes when MessageBox appears. 这可能因应用程序而异,但是在出现MessageBox时,此特定的应用程序/游戏会最小化。

How to avoid this behavior? 如何避免这种行为? Is there anything I can do to the MessageBox to make it lose focus/not activated ? 我可以对MessageBox做些什么使其失去焦点/未激活? I tried to look at the MessageBox methods but no luck. 我试图看一下MessageBox方法,但是没有运气。

It sounds like you want the message box to be able to display while the rest of your code is still running. 听起来您希望消息框能够在其余代码仍在运行时显示。 Type of messagebox you are using is modal and needs to be closed until it allows you to interact with the other open window. 您正在使用的消息框类型是模式的,需要关闭后才能允许您与其他打开的窗口进行交互。

I suggest you start a new thread for the message box so that the thread can continue to run allowing you to be able to interact with the other windows. 我建议您为消息框启动一个新线程,以便该线程可以继续运行,从而使您能够与其他窗口进行交互。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM