Solved

Right mouse button click

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
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…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 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