Windows中全屏模式下有另一个应用程序处于活动状态时,如何打开应用程序窗口? [英] How to open an application window while there is another application active in fullscreen mode in Windows?

查看:227
本文介绍了Windows中全屏模式下有另一个应用程序处于活动状态时,如何打开应用程序窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况如下:

我的WPF Windows应用程序的用户不会经常使用它.取而代之的是,他大部分时间将以全屏模式使用另一个应用程序,有时它是一个ERP系统.这些用户中有许多将成为杂货店的现金服务员,这就是为什么他们大部分时间都在其机器上激活全屏应用程序的原因.

The user of my WPF Windows application won't be using it very often. Instead, he will be most of time using another application in fullscreen mode, sometimes it being an ERP system. Many of these users will be cash attendants in groceries, and that's why they will have a fullscreen application active most of the time in their machines.

这些用户在进行销售时,根据买方的不同,他们将必须访问我的应用程序以确认有关买方的某些信息,但是我的应用程序不会以任何方式与卖方应用程序集成.用户将负责切换到我的应用程序,然后他们又回到他的主应用程序.

While these users are making sales, depending on the buyer, they will have to access my application to confirm some information about the buyer, but my application will not be integrated with the seller application in any way. The user will be responsible from switching to my application and them coming back to his main application again.

但是由于用户的主应用程序有时会在全屏模式下处于活动状态,因此我需要确保他能够在不关闭全屏应用程序的情况下打开我的应用程序.最好的办法是,当用户打开我的应用程序,使用它,然后再次将其最小化时,主应用程序在屏幕上保持可见.

But since the user's main application will sometimes be active in fullscreen mode, I need to make sure that he will be able to open my application, without closing the fullscreen application. It would be even best if the main application stay visible on screen while the user opens my application, uses it and then minimize it again.

这是一个连续的过程,将在用户的整个工作日内执行.因此,用户将始终打开以下两个应用程序:我的和他的主应用程序,仅在需要时才切换到我的应用程序,但他的应用程序始终处于全屏模式.

This will be a continuous proccess that will be being executed through all working day of the user. So the user will be allways with both of the application open: mine and his main app, switching to my application only when he needs to, but with his app always in fullscreen mode.

很抱歉,如果问题不是很清楚,我可以尝试在注释中更好地解释它.谢谢您的帮助!

Sorry if the question is not very clear to understand, I can try to explain it better in the comments if necessary. Thank you for your help!

推荐答案

window.TopMost = true; // this will make the window top most
window.Activate();

我认为这两种方法都可以做到.您还可以处理deactivate事件并再次激活窗口……类似这样:

A combination of these two shoud do it I think. You can also handle the deactivate event and activate your window again ... something like this:

private void Window_Deactivated(object sender, EventArgs e)
{
    Window window = (Window)sender;
    window.TopMost = true;
    window.Activate();
}

这篇关于Windows中全屏模式下有另一个应用程序处于活动状态时,如何打开应用程序窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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