//----------- .H
private: // User declarations
TWndMethod OldScrollBoxWndProc;
void __fastcall ScrollBoxWndProc(TMessage& Message);
//------ .CPP
void __fastcall TForm3::FormCreate(TObject *Sender)
{
OldScrollBoxWndProc = ScrollBox1->WindowProc;
ScrollBox1->WindowProc = ScrollBoxWndProc;
}
void __fastcall TForm3::ScrollBoxWndProc(TMessage& Message)
{
switch (Message.Msg)
{
case WM_VSCROLL:
{
//int nPosituin_V = (int) HIWORD(Message.WParam);
}
break;
case WM_HSCROLL:
{
//int nPosituin_H = (int) HIWORD(Message.WParam);
Caption = (int) HIWORD(Message.WParam);
int newPos = (int) HIWORD(Message.WParam);
Head_DPanel->Cancas->Draw(-newPos,0,bmp_Head1);
Head_DPanel->Repaint();
}
break;
case WM_MOUSEMOVE:
{
PAN_X=LOWORD(Message.LParam);
PAN_Y=HIWORD(Message.LParam);
}
break;
}
OldScrollBoxWndProc(Message);
}