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.
// example: CREATE WINDOW hWndDemo; STYLE WS_OVERLAPPEDWINDOW; TITLE "my window resizable"; AT 0,0 SIZE 800,600; ON PAINT DoScrPaint(); ON MSG DoEventHandler() // <<< sth like that
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)
1 to 3 of 3