Why do you think you need a Hook? You just need to handle the event
System.Windows.Forms.Control.OnMouseWheel
:
MyControl.OnMouseWheel += (sender, eventArgs) => {
GoogleEarth.ZoomBy(eventArgs.Delta);
}
I see you also want to use C# v.2. In this case, the lambda form will not work. You need to use older syntax:
using System.Windows.Forms;
MyControl.OnMouseWheel += delegate(object sender, MouseEventArgs eventArgs) {
GoogleEarth.ZoomBy(eventArgs.Delta);
}
In this form you need explicit declaration of the delegate arguments as the type inference was not yet introduced in C# v.2.
The property
Delta
here gets a signed value of the wheel rotation which caused the event. For more detail, please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.mouseeventargs.aspx[
^].
—SA