Recent

Author Topic: the WMGetMinMaxInfo Not supported  (Read 4441 times)

dtamadeEx

  • New Member
  • *
  • Posts: 17
the WMGetMinMaxInfo Not supported
« on: September 17, 2018, 07:52:17 am »
Code: Pascal  [Select][+][-]
  1.   TForm1 = class(TForm)
  2.   private
  3.     { private declarations }
  4.         procedure WMGetMinMaxInfo(var aMessage: TWMGetMinMaxInfo); message WM_GetMinMaxInfo;
  5.  
  6.   public
  7.     { public declarations }
  8.   end;  
  9.  
  10. procedure TForm1.WMGetMinMaxInfo(var aMessage: TWMGetMinMaxInfo);
  11. begin
  12.   // No execution ...
  13.   aMessage.MinMaxInfo^.ptMinTrackSize.X := 400;
  14.   aMessage.Result := 0;
  15.   inherited;
  16. end;
  17.  



balazsszekely

  • Guest
Re: the WMGetMinMaxInfo Not supported
« Reply #1 on: September 17, 2018, 11:12:47 am »
Try something like this:
Code: Pascal  [Select][+][-]
  1. uses windows;
  2.  
  3. var
  4.   PrevWndProc: WNDPROC;
  5.  
  6. function WndCallback(AHWND: HWND; uMsg: UINT; wParam: WParam; lParam: LParam): LRESULT; stdcall;
  7. begin
  8.   case uMsg of
  9.     WM_GETMINMAXINFO:
  10.     begin
  11.       PMinMaxInfo(LParam)^.ptMaxSize.x := 400;
  12.       PMinMaxInfo(LParam)^.ptMaxSize.y := 400;
  13.       Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, lparam);
  14.       Exit;
  15.     end;
  16. {    WM_OtherStuffHere
  17.     begin
  18.  
  19.     end;}
  20.   end;
  21.   Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);
  22. end;
  23.  
  24. procedure TForm1.FormCreate(Sender: TObject);
  25. begin
  26.   PrevWndProc := Windows.WNDPROC(SetWindowLongPtr(Self.Handle, GWL_WNDPROC, PtrInt(@WndCallback)));
  27. end;

dtamadeEx

  • New Member
  • *
  • Posts: 17
Re: the WMGetMinMaxInfo Not supported
« Reply #2 on: September 17, 2018, 11:49:21 am »
Try something like this:
Code: Pascal  [Select][+][-]
  1. uses windows;
  2.  
  3. var
  4.   PrevWndProc: WNDPROC;
  5.  
  6. function WndCallback(AHWND: HWND; uMsg: UINT; wParam: WParam; lParam: LParam): LRESULT; stdcall;
  7. begin
  8.   case uMsg of
  9.     WM_GETMINMAXINFO:
  10.     begin
  11.       PMinMaxInfo(LParam)^.ptMaxSize.x := 400;
  12.       PMinMaxInfo(LParam)^.ptMaxSize.y := 400;
  13.       Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, lparam);
  14.       Exit;
  15.     end;
  16. {    WM_OtherStuffHere
  17.     begin
  18.  
  19.     end;}
  20.   end;
  21.   Result := CallWindowProc(PrevWndProc, Ahwnd, uMsg, WParam, LParam);
  22. end;
  23.  
  24. procedure TForm1.FormCreate(Sender: TObject);
  25. begin
  26.   PrevWndProc := Windows.WNDPROC(SetWindowLongPtr(Self.Handle, GWL_WNDPROC, PtrInt(@WndCallback)));
  27. end;

thank you!

 

TinyPortal © 2005-2018