473,395 Members | 2,796 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 6318
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: deko | last post by:
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.aspx?scid=kb;en-us;278379), which...
2
by: Jack | last post by:
Hi all, I searched the archives and found everyone happy with Stephen's MouseWheel On/Off code except for those with subforms. Stephen's page indicates that he has added code to handle subforms...
0
by: Mark Johnson | last post by:
Seems the mousewheel isn't controlled in earlier versions like A97 or 2000. So you can accidentally use the mousewheel to scroll to the next record in an unbound form. And that can cause Access to...
1
by: Niranjan | last post by:
I have a data entry form. I am trying to avoid users accidentally using the mouse wheel and saving an incomplete record (or saving record that skips the validation routine). In Mousewheel event,...
5
by: Dennis | last post by:
I have a form with buttons and a custom control I wrote showing a list of items. I would like to scroll the list when the mouse is over the control and the mouse wheel is moved but yet don't want...
1
by: Nicholas Shewmaker | last post by:
(I apologize if this posts twice. My AVG is being fussy.) From what I've read, MouseWheel is a very tricky event. I have replaced my Python tcl84.dll and tk84.dll files with those in the...
7
by: James | last post by:
Hi, I have a Windows Forms application which uses multiple child forms (MDI interface). The height of one of the child forms is larger than the height of the MDI client area, so when this...
3
by: Dave K | last post by:
I seem to be missing something... I want to use a mousewheel event in my VB.NET app... and there's a lot of example code on the net showing how to use the mousewheel event... and the .NET docs...
0
by: WaterWalk | last post by:
Hello. When I tried to make Tkinter canvas widget respond to MouseWheel event on Windows XP, I failed. The canvas just doesn't receive MouseWheel event. I used bind_all to find out which widget...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
In a database search application (vb2005), the user wants to be able to scroll through records using the mousewheel. The data display form contains textboxes for the main data and a datagridview...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.