在多屏幕环境中隐藏/禁用桌面,并在主屏幕顶部显示应用程序 [英] Hide/disable desktop in multiple screen invironment and show application on top of primary screen

查看:94
本文介绍了在多屏幕环境中隐藏/禁用桌面,并在主屏幕顶部显示应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开始一个WPF应用程序,在该应用程序中,主对话框/主对话框将仅包含一个菜单系统(可能是转盘或诸如sony playstation 3菜单之类的东西).当此菜单处于活动/可见/启用状态时,我希望其他所有内容都被隐藏 花式在我的菜单项背景中模糊了.在多显示器设置中,我希望所有显示器的桌面区域都被隐藏/模糊并且处于非活动状态,并且菜单应仅在主显示器上显示.非常重要的是,什么都不要 位于我的菜单前面,并且在显示菜单时不能访问.不是活动气球提示等.

Im about to begin an WPF application in which the main/primary dialog will only consist of a menu system (maybe a carousel og something like a sony playstation 3 menu) . When this menu is active/visible/enabled I want everything else to be hidden og more fancy blurred out in the background of my menu items. In a multiple monitor setup I want all monitors desktop area to be hidden/blurred out and inactive, and the menu should only be shown on the primary monitor. It is very important that nothing should ever be in front of my menu and should not be reachable when the menu is shown. Not event balloon tips etc.

实际上,我希望它的行为类似于Windows7中将要安装应用程序且UAC要求权限的情况.在这种情况下,只能处理对话框(语言栏除外).

Actually I want it to behave like what happens in Windows7 when an application is about to be installad and the UAC ask for the permissions. In this situation only the dialog can be handled (besides the language bar).

有人对如何做到这一点有任何想法.

Does anyone have an idea om how this can be done. And can it at all be done?

推荐答案

Hi:

创建最顶层的全屏窗口(一个窗口,大小等于或略小大于监视器)作为背景.创建主要"广告全部拥有的对话框 屏幕窗口.

Create a topmost full screen window (a window as large as or slightly larger than the monitor) for the background.  Create the "primary" dialog owned by the full screen window.

要创建花哨的模糊效果,请捕获现有的屏幕截图窗口(这可能需要p调用GetDC(NULL)才能获取桌面的本机HDC 然后从中提取到位图),然后应用您想要的任何淡入淡出或模糊变换.

To create the fancy blurred out effect, capture a screenshot of the existing window (this might require p-invoking GetDC(NULL) to get the native HDC for the desktop and then blitting from that to a bitmap) and then apply whatever fading or blurring transform you'd like. 

这会将大多数其他内容隐藏在您的窗口后面.没有什么好方法可以防止另一个最上面的窗口显示在最上面的窗口上方( 如果两个窗口都希望始终位于最顶层?).由于用户正在与您的用户交互,因此他们不太可能将其他用户放在首位,但是仍然可以显示不是由用户输入触发的通知.

This will hide most everything else behind your window.  There is no good way to prevent another topmost window from displaying above your topmost window (what if two windows both wanted to always be topmost?).  Since the user is interacting with yours it is unlikely they will bring another on top, but notifications which aren't triggered by user input could still display.

此屏幕快照和全屏窗口过程实质上是UAC在执行此操作时所执行的操作它使桌面变暗;但是,出于安全目的,它又需要采取进一步措施,并且 创建并切换到安全桌面.在这个单独的桌面中,没有其他运行具有创建通知等权限的应用程序.您的应用程序可以创建一个辅助桌面,切换到该桌面,然后启动菜单应用程序 在该桌面上.菜单应用程序退出时,它将切换回默认桌面并关闭新桌面.

This screenshot and full-screen window procedure is essentially what UAC does when it dims the desktop; however, it takes one further step for security purposes and creates and switches to the secure desktop.  In this separate desktop, there are no other applications running with access to create notifications etc.  Your application could create a secondary desktop, switch to it, and then launch the menu application in that desktop.  When the menu application exits it would switch back to the default desktop and close the new desktop.

桌面:

Desktops: http://msdn.microsoft.com/en-us/library/ms682573(VS.85).aspx

单独的台式机旨在作为安全屏障,并可能在其他方面应用更加困难.为此创建一个单独的桌面 在大多数情况下是过度杀伤力.

The separate desktops are intended as security barriers and may make other aspects of the application more difficult.   Creating a separate desktop for this is overkill in most cases. 

谢谢

Wendell


这篇关于在多屏幕环境中隐藏/禁用桌面,并在主屏幕顶部显示应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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