Method One WindowProc
void __fastcall Mywindowproc (messages::tmessage &message); Increase
Classes::twndmethod Oldwindowproc; Increase
void __fastcall Tform1::mywindowproc (messages::tmessage &message)
{
if (message.msg = = WM_MouseWheel)
{
:: MessageBox (NULL, "OK", "Message", 0); Test
Caption = Now ();
}
Else
Oldwindowproc (Message);
}
void __fastcall tform1::formcreate (tobject *sender)
{
oldwindowproc=edit1->windowproc;
edit1->windowproc=mywindowproc;
}
Method two Message_map
Class Tform1:public Tform
{
__published://Ide-managed components
Tedit *edit1;
Private://User declarations
void __fastcall Oneditmousewell (tmessage &message);
Begin_message_map
Message_handler (WM_MouseWheel, Tmessage, Oneditmousewell)
End_message_map (tform)//tform change to Tedit
Public://User declarations
__fastcall TForm1 (tcomponent* Owner);
};
void __fastcall Tform1::oneditmousewell (tmessage &message)
{
if (String (Activecontrol->classname ()) = = "Tedit")//All Edit
Caption = Now (); Test
Tform::D ispatch (&msg);
}
Method three-load WndProc
Private://User declarations
void __fastcall WndProc (messages::tmessage &message);
void __fastcall Tform1::wndproc (messages::tmessage &message)
{
if (message.msg = = WM_MouseWheel && message.wparam)
{
Caption = Now ();
}
Tform::wndproc (Message);
}
C++builder Heavy-duty WindowProc, WndProc