dotMorten / WinUIEx

WinUI Extensions
https://dotmorten.github.io/WinUIEx
MIT License
572 stars 36 forks source link

WindowExtensions.cs, MoveAndResize() #122

Closed vfib closed 1 year ago

vfib commented 1 year ago

Hello together, I would like to move my window without resizing it.

SetWindowPositionAndSize(IntPtr hwnd, double x, double y, double width, double height)

So I read the doc of the MoveAndResize in WindowExtensions.cs, which states that for keeping the actual size

Width of the window in device independent pixels, or null if keeping the current size Height of the window in device independent pixels, or null if keeping the current size

I would have to set a non nullable double to null? Perhaps im just missing something but generally Im curious about this. There is a function named SetWindowSize to only set the size, but no function to only set the position. Is this related to DPI things? When using SetWindowPos from user32 I can set SWP_NOSIZE, but here its kind of irritating for me.

dotMorten commented 1 year ago

Looks like the doc is wrong (I'll get that fixed). The size isn't nullable. You can just pass in the current width and height to avoid resize.

dotMorten commented 9 months ago

Now available in v2.3 release