我怎样才能prevent其他应用程序窃取的重点是什么? [英] How can I prevent other apps from stealing the focus?

查看:192
本文介绍了我怎样才能prevent其他应用程序窃取的重点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个全屏窗口设置为true最上面的属性。当应用程序改变它的WindowState属性,即使它具有活动焦点我的窗口会自动最小化。例如,code以下举例说明了问题。窗口3秒后已停用,从最小化变为正常,尽量减少其他全屏应用程序。

I have a fullscreen window with the Topmost property set to true. Whenever an application changes its WindowState property, my window is automatically minimized even though it has the active focus. For example, the code below exemplifies the problem. 3 seconds after the window is deactivated, it changes from Minimized to Normal, minimizing the other fullscreen application.

// Topmost = false
private void Form1_Deactivate(object sender, EventArgs e)
{
    System.Threading.Thread.Sleep(3000);
    this.WindowState = FormWindowState.Normal;
}

有没有一种方法,以preserve在这种情况下全屏窗口的WindowState属性?我希望用户选择,以尽量减少全屏应用程序,所以我想阻止其他程序窃取焦点。

Is there a way to preserve the fullscreen window's WindowState property in such a case? I want the user to choose to minimize the fullscreen app, so I want to stop other programs from stealing the focus.

推荐答案

您可能需要调查的Kiosk模式

这篇关于我怎样才能prevent其他应用程序窃取的重点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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