我在重载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去掉