Solved

Right mouse button click

Posted on 2002-04-19
4
190 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
Comment Utility
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
Comment Utility
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
Comment Utility
Hello,

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

Expert Comment

by:DrDelphi
Comment Utility
var msg:tagMSG;


Sorry about that.

Happy coding!!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

763 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now