Hi. I’m new to Xojo and I’m still getting to grips with things. I’ve got a problem below.
I have a working WndProc catching messages on my window. I’m trying to stop the window sizing too small by trapping WM_GETMINMAXINFO but I can’t figure out how to resolve lParam into a structure when its passed in as an Integer.
In other languages, I would cast lParam as MINMAXINFO pointer and access the structure that way, but I can’t seem to get it working in Xojo. I’ve tried all sorts of pointers and casting but I can’t get it right. Could someone please point me in the right direction? Many thanks
[code]Private Shared Function theNewWndProc(hWnd as Integer, msg as Integer, wParam as Integer, lParam as Integer) As Integer
Const WM_GETMINMAXINFO = &h0024
if msg = WM_GETMINMAXINFO then
// lParam is a pointer to a MINMAXINFO structure, how can I assign and use that here?
// I have corrently defined structure for MINMAXINFO as described on the
// MSDN page here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms632626(v=vs.85).aspx
end if
Declare Function CallWindowProcW Lib “User32” ( oldProc As Ptr, handle As Integer, msg As Integer, wParam As Integer, lParam As Integer ) As Integer
Return CallWindowProcW( theOldWndProc, hWnd, msg, wParam, lParam )
End Function
[/code]