I have some windows docked to edges/corners of the working area, and I need to know if/when the WorkingArea of the screen changes so I can update the position of those windows. I've attempted to tackle this before to no avail, as I recall.
views:
47answers:
3One way would be to register your windows as an Application Desktop Toolbar (AppBar) http://msdn.microsoft.com/en-us/library/bb776821(VS.85).aspx Then the system will send you notifications when your window needs to be repositioned, resized etc. For example an AppBar receives a ABN_POSCHANGED notification from the system when something occurs that will affect the size/position/visiblity etc. of the AppBar.
You will need to interop to do this, here is a Code Project article on doing this with C#, though I have only done with C++ so I cannot vouch for the article, but it should be a fair starting point. http://www.codeproject.com/KB/dotnet/AppBar.aspx
I ended up just taking the very simple approach of running a DispatcherTimer
that ticks every two seconds and simply checks the current WorkingArea against the last-checked WorkingArea, sending an event if they are different.