472,096 Members | 1,224 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,096 software developers and data experts.

MouseWheel off without DLL?

Is it possible to disable the mouse wheel WITHOUT using a DLL?

I've looked at Microsoft Knowledge Base Article 278379
(http://support.microsoft.com/default...;en-us;278379), which
explains how to create a DLL and implement code to disable the mouse wheel,
as well as Mr. Lebans' code in MouseWheelHookA2K.zip
(http://www.lebans.com/mousewheelonoff.htm), but both require a DLL.

Sure, it's easy enough to run:

regsvr32 "C:\Program Files\MyDatabase\MouseWheel.DLL"

But the less users have to do the better. I think I remember seeing some
code somewhere that did not use a DLL... or was just an illusion?
Nov 12 '05 #1
6 6207
Did you even notice with my solution that you MUST NOT try to Register
the MouseHook DLL as it is a standard WIndows DLL not an ActiveX DLL.
You simply copy the DLL into the same folder as your MDB and your users
do not have to do anything.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"deko" <de**@hotmail.com> wrote in message
news:mk******************@newssvr25.news.prodigy.c om...
Is it possible to disable the mouse wheel WITHOUT using a DLL?

I've looked at Microsoft Knowledge Base Article 278379
(http://support.microsoft.com/default...;en-us;278379), which explains how to create a DLL and implement code to disable the mouse wheel, as well as Mr. Lebans' code in MouseWheelHookA2K.zip
(http://www.lebans.com/mousewheelonoff.htm), but both require a DLL.

Sure, it's easy enough to run:

regsvr32 "C:\Program Files\MyDatabase\MouseWheel.DLL"

But the less users have to do the better. I think I remember seeing some code somewhere that did not use a DLL... or was just an illusion?


Nov 12 '05 #2
> Did you even notice with my solution that you MUST NOT try to Register
the MouseHook DLL as it is a standard WIndows DLL not an ActiveX DLL.
You simply copy the DLL into the same folder as your MDB and your users
do not have to do anything.


I see. I wasn't sure what the difference was between the MouseHook.DLL and
the DLL I created from the KB article. I'll take another look...
Nov 12 '05 #3
My DLL is written in C++ and uses an application wide MessageHook. This
means the subclassing code resides in the DLL(safer) and you only have
to invoke the MouseWheelOff function once and it looks after all forms
you may open during the current session. It also allows the MouseWheel
to continue to work where it should, in controls with ScrollBars
including SubForm controls.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"deko" <de**@hotmail.com> wrote in message
news:Qt*******************@newssvr29.news.prodigy. com...
Did you even notice with my solution that you MUST NOT try to Register the MouseHook DLL as it is a standard WIndows DLL not an ActiveX DLL. You simply copy the DLL into the same folder as your MDB and your users do not have to do anything.
I see. I wasn't sure what the difference was between the

MouseHook.DLL and the DLL I created from the KB article. I'll take another look...


Nov 12 '05 #4
> My DLL is written in C++ and uses an application wide MessageHook. This
means the subclassing code resides in the DLL(safer) and you only have
to invoke the MouseWheelOff function once and it looks after all forms
you may open during the current session. It also allows the MouseWheel
to continue to work where it should, in controls with ScrollBars
including SubForm controls.


Sounds great. The joker in the pack is that I want to keep the mouse wheel
functionality on the main form in my mdb, and selectively disable it on
other forms, some of which are popups.

I've imported the standard module from A2KMouseWheelHookVer21 and *did not
put any code* in the main form's module. I put this code in the other
(popup) forms' Form_Load events:

Private Sub Form_Load()
Dim blRet As Boolean
blRet = MouseWheelOFF(False)
End Sub

And this code in the popup forms' Form_Close events:

Private Sub Form_Close()
Dim blRet As Boolean
blRet = MouseWheelON
End Sub

Does this sound about right? Is it okay to use the above code to turn the
mouse wheel on and off for different forms? Does it matter if I put the
code in the Form_Open event rather than in the Form_Load event?

It seems to be working... and I did not have to register the DLL :)
Nov 12 '05 #5
There are no problems with your current implementation.

I do not understand why you would want to leave the MouseWheel turned on
for your main form. You can't possibly want to allow the users to
inadvertently scroll through the Recordset. Remember, with the
MouseWheel turned off the wheel still works for all of the controls but
simply will not allow the user to scroll through the recordset unless
they place the cursor within the Record Navigation ToolBar.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"deko" <de**@hotmail.com> wrote in message
news:Kt*******************@newssvr29.news.prodigy. com...
My DLL is written in C++ and uses an application wide MessageHook. This means the subclassing code resides in the DLL(safer) and you only have to invoke the MouseWheelOff function once and it looks after all forms you may open during the current session. It also allows the MouseWheel to continue to work where it should, in controls with ScrollBars
including SubForm controls.
Sounds great. The joker in the pack is that I want to keep the mouse

wheel functionality on the main form in my mdb, and selectively disable it on other forms, some of which are popups.

I've imported the standard module from A2KMouseWheelHookVer21 and *did not put any code* in the main form's module. I put this code in the other
(popup) forms' Form_Load events:

Private Sub Form_Load()
Dim blRet As Boolean
blRet = MouseWheelOFF(False)
End Sub

And this code in the popup forms' Form_Close events:

Private Sub Form_Close()
Dim blRet As Boolean
blRet = MouseWheelON
End Sub

Does this sound about right? Is it okay to use the above code to turn the mouse wheel on and off for different forms? Does it matter if I put the code in the Form_Open event rather than in the Form_Load event?

It seems to be working... and I did not have to register the DLL :)


Nov 12 '05 #6
I do not understand why you would want to leave the MouseWheel turned on for your main form. You can't possibly want to allow the users to inadvertently scroll through the Recordset.


There is some value add to the users if they can scroll. The database is a
Personal Information Manager.


Nov 12 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by deko | last post: by
reply views Thread by Mark Johnson | last post: by
1 post views Thread by Niranjan | last post: by
5 posts views Thread by Dennis | last post: by
1 post views Thread by Nicholas Shewmaker | last post: by
3 posts views Thread by Dave K | last post: by
reply views Thread by WaterWalk | last post: by
1 post views Thread by =?Utf-8?B?UmljaA==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.