简体   繁体   English

Windows XP将屏幕淡化为灰色时,如何通知我?

[英]How can I be notified when Windows XP fades the screen to gray?

We have an application developed in C# with WPF (.NET Framework 3.0) 我们有一个使用WPF(.NET Framework 3.0)用C#开发的应用程序

The main window has a glass border, and a child window containing a WebBrowser is centered within it: 主窗口具有玻璃边框,而包含WebBrowser的子窗口位于其中居中:

WPF main window 
  -> Child window - frame control 
    -> Page 
      -> WindowsFormsHost
        -> WebBrowser

Because we used .NET 3.0, we have to put WebBrowser in WindowsFormsHost, and it can't show if we set the window property AllowTransparency to true. 由于使用的是.NET 3.0,因此必须将WebBrowser放入WindowsFormsHost中,如果将窗口属性AllowTransparency设置为true,则无法显示。

Now, on Windows XP, when the user clicks the Shutdown button on the Start menu, a dialog is displayed with various choices (shutdown, restart, etc.) while behind it the entire desktop appears to fade from color to shades of gray. 现在,在Windows XP上,当用户单击“开始”菜单上的“关闭”按钮时,将显示一个对话框,其中有各种选择(关闭,重新启动等),而在其后,整个桌面似乎从彩色逐渐淡入灰色。 When this occurs, our main window becomes hidden, while the page window is still displayed on the screen. 发生这种情况时,我们的主窗口将隐藏,而页面窗口仍显示在屏幕上。

We have already set page window's owner to be the main window, but this did not help. 我们已经将页面窗口的所有者设置为主窗口,但这没有帮助。 Therefore, I have come to the conclusion that I must intercept the "fade to gray" event and... do something to mitigate this ugliness. 因此,我得出的结论是,我必须拦截“淡入灰色”事件,并...采取一些措施来减轻这种丑陋感。 So: does anyone know how I might allow my program to be notified prior to the fade to gray? 那么:有谁知道在淡化为灰色之前如何允许我的程序得到通知?

As I know there is no way to be notified when Windows fades the screen to gray. 据我所知,当Windows将屏幕渐变为灰色时,没有任何方法可以得到通知。 System.SystemEvents class doesn't have such an event either. System.SystemEvents类也没有此类事件。

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

相关问题 我如何在Windows(xp,vista,7)欢迎屏幕或锁定屏幕(如VNC或Dame Ware)中进行交互 - how can i interact in windows (xp, vista, 7) welcome screen or locked screen like a VNC or Dame Ware 当我在 Xamarin 应用程序中调用 DisplayAlert 时,屏幕变暗但不显示警报 - When I call DisplayAlert in a Xamarin app, the screen fades but no alert is displayed 当集合类型 DP 发生变化时如何通知我? - How can I be notified when collection-type DP is changed? 如何在Windows XP上成功关闭TextWriter流? - How can I close the TextWriter stream on Windows XP successfully? 如何在Xp中使用Windows Mobile Center? - How can I used Windows Mobile center in Xp? 如何在 C# 中获取 Windows XP 产品密钥? - How can I get windows XP product key in C#? 如何使用 C# 或免费的 XP 工具卸载或删除 Windows XP Sp3 游戏? - How can I uninstall or delete Windows XP Sp3 Games using C# or free XP tools? 当听众退订时,我可以收到通知吗? - Can I be notified when a listener unsubscribes? 如何在Windows Server 2003和Windows XP中延迟创建的服务? - How can I delay my created service in Windows Server 2003 & Windows XP? C#如何在windows xp / 7中禁用屏幕键盘声音 - C# how to disable on-screen keyboard sound in windows xp/7
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM