Solved

Right mouse button click

Posted on 2002-04-19
4
192 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
  • 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

810 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