That IS a good question!
I experimented with this a little tonight, adding a menu item to a test app's frame menu to issue a message box that displays the frame window's X, Y position, Width and Height in PBU's and in pixels.
When the frame is maximized, I get these values:
I moved the message box prior to taking the snapshot to be able to keep the snapshot small. My monitor's resolution is 1920 x 1080 pixels. The Windows task bar occupies 40 pixels along the bottom of the screen, making the usable screen area 1920 x 1040.
Note the reported size of the maximized window is 2 x 8 = 16 pixels wider and higher than the usable area, or an extra 8 pixels on all sides.
Then the script changes the WindowState to Normal!, moves the window to -8, -8 (pixels, converted to PBU's) and resizes the window to 1936 x 1056 (pixels, converted to PBU's)... the same values as reported when the window is maximized, then the properties are displayed once more in a message box:
It's a little difficult to discern from these snapshots, but even though the window's reported position and size are the same, it is being rendered a little differently (note the X-position of the app's icon and how it aligns differently over the menu item "File"). You can't see it with these images displayed against a white background, but in the second image the icon and window title are a few pixels closer to the top edge of the screen.
What does it mean? I'm not sure. I'm guessing that PB assigns these property values as a "special case" when the window is maximized. Therefore, I would be hesitant to use these properties to "restore" a window if it were maximized. I would instead set the WindowState property to Maximized! and use Move & Resize methods only when the WindowState = Normal!, or keep track of the windows position & size PRIOR to it being maximized/minimized and save those values, then restore these values and set the WindowState to Maximized!
I guess it depends how nit-picky you want to be with the window save/restore functionality. Still, a very interesting issue!
https://docs.microsoft.com/en-us/windows/win32/gdi/the-virtual-screen
(2) Use MonitorFromPoint API function and a WinAPI POINT structure (comprised of two Long's) with the desired X,Y coordinates (not negative values, as there will not be on the desired monitor). Use MONITOR_DEFAULTTONULL (which is defined as zero) fir the dwFlags argument.
(3) If the specified point does not reside on any current monitor, the function will return NULL (this is a Windows API NULL, which is zero, not a PB Null). If the point does exist in any monitor, the function will return the HMONITOR (Handle to the Monitor), which can be used to identify the particular monitor.
Thank you all for your input on this. Couldn't do it without you!
Chris