By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,466 Members | 1,588 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,466 IT Pros & Developers. It's quick & easy.

MouseWheel off without DLL?

P: n/a
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
Share this Question
Share on Google+
6 Replies


P: n/a
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

P: n/a
> 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

P: n/a
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

P: n/a
> 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

P: n/a
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

P: n/a
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.