Board index » cppbuilder » Getting Mouse coordinates
Henk van Winkoop
![]() CBuilder Developer |
Henk van Winkoop
![]() CBuilder Developer |
Getting Mouse coordinates2005-10-26 03:01:30 PM cppbuilder80 Hello, Maby this is a stupid question, but how do I retrieve the actual mouse position coordinates from my Form? Do I have to place some mouse component on it? Thanks Henk |
Henk van Winkoop
![]() CBuilder Developer |
2005-10-26 03:24:07 PM
Re:Getting Mouse coordinates
A single reply...
GREAT!!!! thanks "Alexander Aliev" < XXXX@XXXXX.COM >schreef in bericht QuoteHi, |
Alexander Aliev
![]() CBuilder Developer |
2005-10-26 03:24:30 PM
Re:Getting Mouse coordinates
Hi,
Quote...how do I retrieve the actual mouse int XX = Mouse->CursorPos.x; int YY = Mouse->CursorPos.y; You don't need any component for this. Bye, Alexander {smallsort} |
Henk van Winkoop
![]() CBuilder Developer |
2005-10-26 03:31:01 PM
Re:Getting Mouse coordinates
I see that mouse coords are according display-size settings.
Is it possible to retrieve the actual screensize (like 1280 * 1024 or so) ? thanks Henk "Alexander Aliev" < XXXX@XXXXX.COM >schreef in bericht QuoteHi, |
Henk van Winkoop
![]() CBuilder Developer |
2005-10-26 03:33:09 PM
Re:Getting Mouse coordinates
I will answer myself...
I found the 'Screen' variable like the 'Mouse' one! ;-) "Henk van Winkoop" < XXXX@XXXXX.COM >schreef in bericht QuoteI see that mouse coords are according display-size settings. |
JD
![]() CBuilder Developer |
2005-10-26 03:53:56 PM
Re:Getting Mouse coordinates
"Henk van Winkoop" < XXXX@XXXXX.COM >wrote:
Quote
point to a control relative point using ScreenToClient. For example: TPoint P; ::GetCursorPos( &P ); P = ScreenToClient( P ); Mouse->CursorPos may be the same (I hope it is) but IIRC, when I used it with: Application->ActivateHint( Mouse->CursorPos ); the hint displayed at the tail of the mouse instead of the hot spot. Perhaps that's a feature of the hint but I know that the above works correctly. ~ JD |
Henk van Winkoop
![]() CBuilder Developer |
2005-10-26 06:08:04 PM
Re:Getting Mouse coordinates
GREAT!
"JD" < XXXX@XXXXX.COM >schreef in bericht Quote
|