Click here to Skip to main content
15,868,164 members
Please Sign up or sign in to vote.
1.75/5 (4 votes)
See more:
i want the mouse right click should not work when my application is running...and starts when application is closed.....
Posted
Updated 19-Apr-11 2:15am
v2
Comments
[no name] 19-Apr-11 8:11am    
Can you describe the intended purpose of this?

Also, check your caps lock.
snorkie 19-Apr-11 16:22pm    
Why is it that somebody always has to ask "Why are you doing this" when somebody asks an honest question? wouldn't it be easier to answer or not answer. It seems that people are reamed when they don't make their question specific enough, but people can ask this generic question and get away with it.

To shanku.shau: Are you asking for the mouse not to work within your application, or in all of Windows when you are running?
[no name] 19-Apr-11 21:31pm    
The question was not "Why are you doing this?" but rather what is the purpose, and was asked to assertain if alternative could be presented.
DaveAuld 19-Apr-11 8:13am    
Looks like you have managed to Lock your CAPS LOCK key successfully.........:)
Groulien 19-Apr-11 8:15am    
Don't you mean 'How to lock and unlock your Caps Lock'?
Thank the heavens that text-to-speech does not shout when using caps :p .

You want the right mouse button to not work at all while your application is running? What possible reason could you have for wanting to do this?

Stealing the mouse right-button click from other apps is a) not a valid implementation goal, and b) not recommended.
 
Share this answer
 
v2
Comments
Sergey Alexandrovich Kryukov 19-Apr-11 16:36pm    
Attempted computer crime detected, my 5.
--SA
 
Share this answer
 
Comments
BobJanova 19-Apr-11 10:06am    
Good link, which demonstrates how to filter messages within a single application (actually, a single thread, but a WinForms app generally has only a single UI thread). Generally though if you wanted to avoid responding to right clicks in your own app you could just use a boolean static flag somewhere.
Sergey Alexandrovich Kryukov 19-Apr-11 16:39pm    
John assumed that the question was about system-wide block (which is possible but would be a crime against the user). It looks like. If fact, this is not clear.
If it is just for the application, I agree with Bob: good link, I also vote 5.
--SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900