首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ Builder >

小弟我在重载WndProc函数时,运行之后报错

2012-02-16 
我在重载WndProc函数时,运行之后报错!Awin32apifunctionfailed!我的重载过程是这样的:1、在头文件声明:prot

我在重载WndProc函数时,运行之后报错!
A   win32   api   function   failed!

我的重载过程是这样的:
1、在头文件声明:
protected:
  void   __fastcall   WndProc(Messages::TMessage   &Message);
2、在cpp中:
void   __fastcall   TForm1::WndProc(Messages::TMessage   &Message)
{
                //TODO:   Add   your   source   code   here
  if(Message.Msg==iconmessage)//如果产生的是与该图标相关的消息

{

if(Message.LParam==WM_LBUTTONDBLCLK)

Application-> Terminate();

if(Message.LParam==WM_RBUTTONDBLCLK)

{

ShowWindow(Application-> Handle,SW_SHOW);//

Application-> ShowMainForm=true;

Form1-> Visible=true;

}
else
TForm::WndProc(Message);

}
///////////////

请高手指点一下!!!

[解决办法]
把else去掉

热点排行