怎么用C++ Builder消息机制
1个回答
展开全部
.h文件里面
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_USER + 101,TMessage, xxxx);
END_MESSAGE_MAP(TForm)
void __fastcall xxxx(TMessage &Msg);
.cpp 文件
void __fastcall xxxx(TMessage &Msg)
{
switch(Msg.WParam)
{
case 1: break;
case 2:break;
}
}
PostMessage(Handle, WM_USER + 101, 1, 0);
BEGIN_MESSAGE_MAP
VCL_MESSAGE_HANDLER(WM_USER + 101,TMessage, xxxx);
END_MESSAGE_MAP(TForm)
void __fastcall xxxx(TMessage &Msg);
.cpp 文件
void __fastcall xxxx(TMessage &Msg)
{
switch(Msg.WParam)
{
case 1: break;
case 2:break;
}
}
PostMessage(Handle, WM_USER + 101, 1, 0);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询