Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to disable the mouse wheel Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
07-Feb-04
Category
System
Language
Delphi 3.x
Views
141
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Peter Below 

Is there any way to disable the mouse wheel for a particular application or form?

Answer:

You can use a handler for the Application.OnMessage event to filter out messages 
(e.g WM_MOUSEWHEEL) before any control in your application sees them. Note that 
this will not work with all mouse drivers. There are some that can be configured to 
not post the standard wheel messages but to send WM_VSCROLL messages instead if the 
control under the mouse has scrollbars. This "compatibility mode" is there to make 
the wheel usable with applications that do not have wheel support build in.

1   procedure TMainForm.FormCreate(Sender: TObject);
2   begin
3     Application.OnMessage := AppMessage;
4   end;
5   
6   procedure TMainform.Appmessage(var Msg: TMsg; var Handled: Boolean);
7   begin
8     Handled := msg.message = WM_MOUSEWHEEL;
9   end;
10  
11  if you only want to do this for a specific form class you would modify this method 
12  to
13  
14  procedure TMainform.Appmessage(var Msg: TMsg; var Handled: Boolean);
15  begin
16    Handled := (msg.message = WM_MOUSEWHEEL) and
17      (Screen.Activeform is TMySpecialFormclass);
18  end;


			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC