[英]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.