WindowX/Y negative when maximized
Posted: Fri Nov 01, 2013 12:35 am
I'm trying to get the 'true' visible WindowX and WindowY of a maximized window, but I get small negative values. In a test program (see below) the negative values are -3, but in my own program I get -8. Any idea why they are negative and is there a Windows system metric value or something that corresponds to these offsets?
For example, in the following:
I get the following debug messages:
My monitor size is 1366x768, but when the window is maximized WindowX(0) and WindowY(0) both return -3. Why don't they return 0?
For example, in the following:
Code: Select all
If OpenWindow(0, 100, 200, 195, 260, "PureBasic Window", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_MaximizeGadget)
Debug "(open) WindowX(0)=" + WindowX(0) + ", WindowY(0)=" + WindowY(0) + ", WindowWidth(0)=" + WindowWidth(0) + ", WindowHeight(0)=" + WindowHeight(0)
Delay(2000)
SetWindowState(0, #PB_Window_Maximize)
Debug "(max) WindowX(0)=" + WindowX(0) + ", WindowY(0)=" + WindowY(0) + ", WindowWidth(0)=" + WindowWidth(0) + ", WindowHeight(0)=" + WindowHeight(0)
Delay(2000)
SetWindowState(0, #PB_Window_Normal)
Debug "(normal) WindowX(0)=" + WindowX(0) + ", WindowY(0)=" + WindowY(0) + ", WindowWidth(0)=" + WindowWidth(0) + ", WindowHeight(0)=" + WindowHeight(0)
EndIf
I get the following debug messages:
Code: Select all
(open) WindowX(0)=100, WindowY(0)=200, WindowWidth(0)=195, WindowHeight(0)=260
(max) WindowX(0)=-3, WindowY(0)=-3, WindowWidth(0)=1366, WindowHeight(0)=716
(normal) WindowX(0)=100, WindowY(0)=200, WindowWidth(0)=195, WindowHeight(0)=260
