please redirect me if this is the wrong place to place such information
the (very helpful) NTKCORE documentation states that NTK_GETWINDOWRECT returns "an array of 4 items {nTop, nLeft, nWidth, nHeight} receiving the screen coordinates of the upper-left and lower-right corners of the window"
my testing suggests this is incorrect: it returns an array of 4 items representing the X/Y screen coordinates of the top left and bottom right corners of the window {nLeft, nTop, nRight, nBottom}
Hello, You're correct. This is the right place, and yes NTK_GetWindowRect() returns a 4 item's array: {nLeft, nTop, nRight, nBottom}. See down below the actualized version of NTK_GetWindowRect() documentation.
///////////////////////////////////////////////////////////////////////////////////// 0.16.29 NTK_GetWindowRect() Retrieves the integral dimensions of the bounding rectangle of the specified window.
Syntax NTK_GetWindowRect( <hWnd> ) -> aRect
Arguments <hWnd> Handle to the window to get dimensions.
Return Values If this function succeeds, it returns an array of 4 items {nLeft, nTop, nRight, nBottom} receiving the screen coordinates of the upper-left and lower-right corners of the window.
Description This function is used to get dimensions of the bounding rectangle of the specified window. Theses dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
Remarks In Windows Vista and later, the returned aRect[] now includes the area occupied by the drop shadow. N.B. Calling NTK_GetWindowRect() will have different behavior depending on whether the window has ever been shown or not. If the window has not been shown before, NTK_GetWindowRect() will not include the area of the drop shadow.
. . .
STATIC FUNCTION DoEventHandler(hWnd,nMsg,nwParam,nlParam)
Local nW, nH, aWndSize, aMinMaxInfo
Local nMinWndWidth := 320 // min. w. boundary
Local nMinWndHeight := 200 // min. h. boundary
DO CASE
CASE nMsg == WM_GETMINMAXINFO
// get the window dimensions in screen coordinates
aWndSize := NTK_GetWindowRect( hWnd )
// determine the window's actual width and height
nW := aWndSize[RECT_Right] - aWndSize[RECT_Left]
nH := aWndSize[RECT_Bottom] - aWndSize[RECT_Top]
// ----------------------------------------------------------------------------
// prevent user from resizing the window outside the minimum boundaries
// ----------------------------------------------------------------------------
IF nW <= nMinWndWidth .OR. nH <= nMinWndHeight
// Convert the MINMAXINFO structure into an xhb array
aMinMaxInfo := NTK_MinMaxInfo2A( nlParam )
If nW <= nMinWndWidth
// specify the new minimum width
aMinMaxInfo[ MINMAXINFO_ptMinTrackSizeX ] := nMinWndWidth
EndIf
If nH <= nMinWndHeight
// specify the new minimum height
aMinMaxInfo[ MINMAXINFO_ptMinTrackSizeY ] := nMinWndHeight
EndIf
// return the MINMAXINFO structure back to MS-Windows
NTK_SetMinMaxInfo( nlParam, aMinMaxInfo )
ENDIF
// ----------------------------------------------------------------------------
RETURN( 0 )
ENDCASE
RETURN NTK_DefWindowProc(hWnd,nMsg,nwParam,nlParam)
. . .
See Also NTK_GetClientRect(), NTK_ScreenToClient() /////////////////////////////////////////////////////////////////////////////////////