Try using something like an onscreen caliper or ruler just to get the window's width and height. Then you'll see it's simpler and more exact for simple window width and height, to do it via a Windows function. One function call returns the window's size and position to the pixel.
For one example, every time I open Malwarebyes anti-malware it opens at a different spot. If I want to make a script to launch it with position and size, it's trivial if I have the exact numbers. In fact I think I'll do it now because it's annoying launching, then hotkeying it into place every time I run it.
It's probably more useful for programmers than for the average user. If I have a window that's the perfect size for a particular task, there's no pre-fabricated way to get the exact numbers. Often what people do is lay another window on top and mess around with the mouse trying to get the 2 windows to match perfectly. That's a real time waster.