Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
Old 08-10-2000, 09:50 PM   #1
Member (7 bit)
 
kcbhiw's Avatar
 
Join Date: May 2000
Location: Atlanta, Georgia
Posts: 95
Question

Can anybody suggest a way of determining the x and y coordinates of the mouse cursor in a GUI app? I'm using Borland C++ builder 4. I simply want to determine the x and y coordinates and have been racking my brain trying to figure how to accomplish it. Thanks in advance.
kcbhiw is offline   Reply With Quote
Old 08-11-2000, 04:54 AM   #2
Member (9 bit)
 
Join Date: Dec 1999
Location: Midland, NC, USA
Posts: 292
Post

Are you talking about the mouse position when it moves or when it is clicked?

Really, either way, you can trap the mouse position (when it is over the window of your app) by putting code in your Windows message handling loop to trap the mouse move and mouse click events. These windows messages carry the mouse coordinates with them.

I recall there's a pretty decent reference of the windows messages in the online docs. You can also look in the tutorials if you have some C++ learning guides lying around.

You can (sometimes) capture windows messages when the focus in on other apps. It's a bit more difficult, but it can be done.

Sorry about the high-levelness of this. It's been a while since I had my fingers in C++ code.
UncaDanno is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 08:03 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.6.0