Window doesn't show when ShowInTaskbar is false and display is turned off automatically
I met a problem regarding to WPF window on windows vista SP2.
I create a window with following properties:
WindowStyle="None"
ShowInTaskbar="False"
ResizeMode="NoResize"
Background="Transparent"
The ShowInTaskbar is set to false, which means the window will not show taskbar button, but you can see it in the taskbarlist using Alt+tab
In my application, when receiving some events, the window will be created and Show(), for example,
window1 wd = new windw1();
wd.topmost = true;
wd.show();
I happen to find in the followin case, the window is not show correctly
My display setting in the power manager is set to turn off display in 1 minute,
After 1 minute, my display turned off, after that, there is a event which triggered the window to show, but after i move the mouse to get the display back, i didn't see the window is showed, instead, when i use Alt+Tab, i can find a window transparent in t开发者_高级运维he taskbarlist with my application icon. It's very strange. after i click "show desktop" for two times, the window show itself.
i googled in the internet, and found it seems that when showtaskbar is set to false, there will be another transparent window created which is the owner for the current window, this explains that why i can see transparent window in taskbarlist usring Alt+Tab. I assume that the window is not correctly painted in this case.
I think it's a bug of WPF, is there any workaround for it?
Thanks in advance
you can make your application power aware and make it check the monitor's state. Please refer to http://msdn.microsoft.com/en-us/library/ms703398%28VS.85%29.aspx. You can then subscribe to the Powerbroadcasts and get informed, when the monitor is turned back on. On that event, you could force your application to redraw the window in question.
Sadly this is only a workaround and no fix to the initial problem
精彩评论