.h中
class TForm1 : public TForm
{
__published:// IDE-managed Components
private: // User declarations
public: // User declarations
virtual __fastcall TForm1(TComponent* Owner);
void virtual __fastcall RestrictSize(TMessage&
Msg);
// This message map maps the WM_GETMINMAXINFO message to the
// RestrictSize function.
begin
_MESSAGE_MAP
MESSAGE_HANDLER(WM_GETMINMAXINFO,TMessage,RestrictSize)
// Add any number of additional message handlers here.
END_MESSAGE_MAP(TForm)
};
.cpp中
void __fastcall TForm1::RestrictSize(TMessage&
Msg)
{
((POINT far *)Msg.LParam)[3].x = 300;
((POINT far *)Msg.LParam)[3].y = 300;
((POINT far *)Msg.LParam)[4].x = 400;
((POINT far *)Msg.LParam)[4].y = 400;
TForm:
ispatch(&Msg);
}