The code cannot in any way harm your current MDB. All that it does is
listen for MouseWHeel messages being sent to your forms. If the
MouseWHeelHook is enabled then it simply destroys these MouseWHeel
messages BEFORE your form receives them. That's it.
Copy the MouseWHeelHook.DLL file into the same folder as your work MDB
Import the single standard Code module named modMouseHook from my sample
MDB into your own.
Open one and only one of your Forms in your application, preferably the
Form that opens first and closest last.
Open the Form's Properties sheet
Select the Event TAB
For the On Load property select "Event Procedure" from the dropdown
For the On UnLoad property select "Event Procedure" from the dropdown
Now you need to add code for each of the two form events, Load and
Unload. Next tot he dropdown where you selected "Event Procedure" there
is an ellipse(3 periods ...), click on the ellipse and you will find
yourselve in the VB IDE with your cursor in the Load(or Unload) sub.
Add the following code for the Load event
dim blRet as Boolean
blRet = MouseWheelOFF(True, False)
Scroll down and find the Unload event and add the following code:
dim blRet as Boolean
blRet = MouseWheelOn
THe most important thing you need to uderstand is that you only have to
call the MouseWheelOff function ONCE. It will automatically look after
any forms currently open and any that you will open later on.
Similiarly, you only call the MouseWheelOn function ONCE when your
application is closing.
Let me know how you make out.
--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.