April
SMTWTFS
12345
6789101112
13141516171819
20212223242526
27282930

NTK and The NTK Project
are properties of Jn Dechereux
Home | Documentation | FAQ.

Vanilla 1.1.8 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorPoke45
    • CommentTimeJan 9th 2022
     
    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}
    •  
      CommentAuthorTeam NTK
    • CommentTimeJan 11th 2022
     
    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.

    Also, latest NTKCORE_PART2.PDF manual is available for download from both links:
    https://www.ntkproject.com/documentation.php
    https://www.ntkproject.com/ntkwip/

    Thx for pointing this out.
    Your NTK Team.
    •  
      CommentAuthorTeam NTK
    • CommentTimeJan 11th 2022 edited
     
    /////////////////////////////////////////////////////////////////////////////////////
    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.

    Example
    1. . . .  
    2.   
    3. STATIC FUNCTION DoEventHandler(hWnd,nMsg,nwParam,nlParam)  
    4. Local nW, nH, aWndSize, aMinMaxInfo  
    5. Local nMinWndWidth  := 320 // min. w. boundary  
    6. Local nMinWndHeight := 200 // min. h. boundary  
    7.   
    8. DO CASE  
    9.   
    10.    CASE nMsg == WM_GETMINMAXINFO  
    11.         // get the window dimensions in screen coordinates  
    12.         aWndSize := NTK_GetWindowRect( hWnd )  
    13.   
    14.         // determine the window's actual width and height  
    15.         nW := aWndSize[RECT_Right] - aWndSize[RECT_Left]  
    16.         nH := aWndSize[RECT_Bottom] - aWndSize[RECT_Top]  
    17.   
    18.         // ----------------------------------------------------------------------------  
    19.         // prevent user from resizing the window outside the minimum boundaries  
    20.         // ----------------------------------------------------------------------------  
    21.         IF nW <= nMinWndWidth .OR.  nH <= nMinWndHeight  
    22.            // Convert the MINMAXINFO structure into an xhb array  
    23.            aMinMaxInfo := NTK_MinMaxInfo2A( nlParam )  
    24.   
    25.            If nW <= nMinWndWidth  
    26.               // specify the new minimum width  
    27.               aMinMaxInfo[ MINMAXINFO_ptMinTrackSizeX ] := nMinWndWidth  
    28.            EndIf  
    29.   
    30.            If nH <= nMinWndHeight  
    31.               // specify the new minimum height  
    32.               aMinMaxInfo[ MINMAXINFO_ptMinTrackSizeY ] := nMinWndHeight  
    33.            EndIf  
    34.   
    35.            // return the MINMAXINFO structure back to MS-Windows  
    36.            NTK_SetMinMaxInfo( nlParam, aMinMaxInfo )  
    37.         ENDIF  
    38.         // ----------------------------------------------------------------------------  
    39.         RETURN( 0 )  
    40. ENDCASE  
    41.   
    42. RETURN NTK_DefWindowProc(hWnd,nMsg,nwParam,nlParam)  
    43.   
    44.   
    45. . . .  

    See Also
    NTK_GetClientRect(), NTK_ScreenToClient()
    /////////////////////////////////////////////////////////////////////////////////////
    •  
      CommentAuthorPoke45
    • CommentTimeJan 24th 2022
     
    thank you very much for documenting the correction

    just as one comment: i think it would be better if the NTK documentation itself was version-stamped e.g.

    NTKCore PROGRAMMER’s GUIDE
    PART II

    Version: 2022-11-01