Solved

Right mouse button click

Posted on 2002-04-19
4
195 Views
Last Modified: 2010-04-04
Just a quick question :
How can I detect when a user click right mouse button at Windows desktop or any other places outside my application?

Thanks for the help
0
Comment
Question by:totok
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
DrDelphi earned 100 total points
ID: 6953507
setcapture(self.handle);
 While true do
 IF PeekMessage(msg,0,WM_RBUTTONDOWN,WM_RBUTTONDOWN,PM_NOREMOVE) then
 begin
    showmessage('Right Click');
    TranslateMessage(msg);
    DispatchMessage(msg);
    ReleaseCapture;
    Break;
 end;

Good luck!!
0
 

Author Comment

by:totok
ID: 6953922
Hello,

Thank you for the answer. But I have a problem with the "msg" variable. Is there a unit or type that I need to declare first before using it?
0
 

Author Comment

by:totok
ID: 6953931
Hello,

Just iqnore my previous comment.
Thanks for the answer. It's work!
0
 
LVL 6

Expert Comment

by:DrDelphi
ID: 6954086
var msg:tagMSG;


Sorry about that.

Happy coding!!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question