C++builder中如何实现自定义消息(100分)

F

fsxusuh

Unregistered / Unconfirmed
GUEST, unregistred user!
各位高手你们好
请问在C++builder中如何实现自定义消息,最好一例子.
谢谢!
抚顺 徐
fsxusuh@mail.fsptt.ln.cn
2000.11.16
 
去看看电脑报99年的合订本,又一篇文章就是这个
 
.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::Dispatch(&Msg);
}
 
多人接受答案了。
 

Similar threads

顶部