Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Right mouse button click

Posted on 2002-04-19
4
Medium Priority
?
199 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 400 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

Industry Leaders: 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

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…
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…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Suggested Courses

618 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