Syntax
Height.d = WindowGetHeight(Window, Flags=0)
Description
Retrieves the current height of the specified window. By default, it returns the height of the client area (the area inside the borders and title bar) in device-independent pixels (DIPs). Flags can be used to retrieve the outer frame height or the height in physical pixels.
Parameters
Window
The handle of the ProGUI window whose height is to be retrieved.
Flags (optional)
A combination of flags to specify which height to retrieve and in what units. Default is 0 (client area height in DIPs).
#PG_Window_OuterCoordinate : Returns the height of the entire window frame, including borders and title bar.
#PG_Window_ReturnPixels : Returns the height in physical device pixels instead of DIPs.
Note: #PG_Window_InnerCoordinate is the default behavior for height (client area) and doesn't need to be specified unless combined with #PG_Window_ReturnPixels.
Return Value
Returns the requested window height as a floating-point number (Double). The unit (DIPs or pixels) depends on the specified flags. Returns 0.0 or #False if the window handle is invalid.
Remarks
The client area height in DIPs is most commonly used for layout calculations within ProGUI. Use #PG_Window_ReturnPixels when interacting with OS functions that require physical pixel dimensions.
Example
IncludeFile "ProGUI_PB.pbi"
StartProGUI()
MyWindow = CreateWindow(0, 0, 400, 300, "Window Size Info")
If MyWindow
WindowShow(MyWindow, #True, #PG_Window_ScreenCentered)
ClientHeightDIPs.d = WindowGetHeight(MyWindow)
ClientHeightPixels.d = WindowGetHeight(MyWindow, #PG_Window_ReturnPixels)
FrameHeightPixels.d = WindowGetHeight(MyWindow, #PG_Window_OuterCoordinate | #PG_Window_ReturnPixels)
Debug "Client Height (DIPs): " + StrD(ClientHeightDIPs)
Debug "Client Height (Pixels): " + StrD(ClientHeightPixels)
Debug "Frame Height (Pixels): " + StrD(FrameHeightPixels)
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
StopProGUI()
See Also
WindowGetWidth, WindowGetX, WindowGetY, WindowResize
Supported OS
Windows, Linux