Actual Window Width

Is there a cross platform (Mac/PC) way to get the true width of a window? Window.Width is the width the internal displayable area. I want to find the right edge of the window.

I’m sure there’s probably an API call from the OS you can write a declare to find out, such as GetSystemMetrics function

The only thing that makes code cross platform is by using the conditional statement to call the respective APIs based on build target and convert it to a standardized internal format.

Otherwise, if the window is maximized you can compare the size of the screen using screen to the working window size

See the Window.Bounds property.

Well, that looks like exactly what I’m looking for.

Except the Bounds.Right (or Bounds.Left + Bounds.Width) doesn’t take into account the right frame edge on Windows 7 (and possibly others.)

Oh, never mind. I just realized that Window.left is not the the true left either.

The Window properties pertain to the window in focus.

From reading your various answers I think you may want the monitor screen size. This is done with the Screen.AvailableTop, Screen.AvailableLeft, Screen.AvailableWidth or Screen.Left, Screen.Top, Screen.Width and Screen.Height. These will return an integer value.

Thanks Simon. I did mean the actual Window.

I needed to align 2 windows. Here’s a post with my resulting code:

No problem.

Glad you resolved it.