SetWindowPos
can make window larger than screen. But for WPF apps it doesn't work.
Above code is a very simple WPF app, it contains a window with a button at the center (HorizontalAlignment="Center" VerticalAlignment="Center"
).
Click the button will call SetWindowPos(with NOSENDCHANGING option) to resize window to 6000 * 6000.
Now question is: what's the real size of the window? I think it is the same size as screen (instead of 6000*6000).
Why? because the button is now at the center of screen! It is supposed to be at the center of the window.
- run the WPF application above and click the button.
- current window will resize to 6000*6000
- but button is at the center of screen instead of the window. Which means the window contect size actually equals to screen size, not larger than screen