Post by firstname.lastname@example.org
Could somebody translate this code to Delphi please? I got it in an
answer to a problem I was having but the very helpful poster only knew
the C syntax. Can anyone help please?
/* get a pointer to the MINMAXINFO structure that is passed in the
mmi = (MINMAXINFO *)lParam;
/* set the max size for the window */
mmi->ptMaxSize.x = 123;
mmi->ptMaxSize.y = 456;
var mmi : TMinMaxInfo;
//***case WM_GETMINMAXINFO:*** this is coming from a C case (Switch(x)
case 0: case 1: case n:) so this is like a messages processor.
//In delphi you can receive a specific message by doing a procedure
// procedure WMGETMINMAXINFO(var Msg : TMessage); message
procedure WMGETMINMAXINFO(var Msg : TMessage); message
mmi := TMinMaxInfo(Msg.LParam);
mmi.ptMaxSize.x := 123;
mmi.ptMaxSize.y := 456;
DefWindowProc(Handle,WM_GETMINMAXINFO, Msg.WParam, Msg.LParam);
//this last proc will respond to this message and set those values
then passes the message to windows for normal processing but with the
new values you just set :)
let me know if it works.