Board index » delphi » How do i get MOUSE Co-ords in Delphi 2.0

How do i get MOUSE Co-ords in Delphi 2.0

Thank you for taking the time to read this message..

I am having a great amount of trouble finding a way to get the
screen co-ords of the mouse in delphi 2.0

I wish to ultimatly find the location in a Timage box that the mouse has been
clicked.

If anyone has any ideas or knows how to do this I Would

GREATLY APPRECIATE IT!

Anyway thanks

From

Paul

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

 

Re:How do i get MOUSE Co-ords in Delphi 2.0


GetCursorPos(MyPoint);

This will give you the coordinates of the mouse on the screen. The
Mousemove / MouseDown events will tell you the coordinates within the
Image box.

Use MyImageBox.ClientOrigin.X to find the position of the image box on
the screen.

(these things work in D3. Don't know if all of them are applicable to
D2)

Hope this helps.

Quote
Paul_flu...@hotmail.com wrote:

> Thank you for taking the time to read this message..

> I am having a great amount of trouble finding a way to get the
> screen co-ords of the mouse in delphi 2.0

> I wish to ultimatly find the location in a Timage box that the mouse has been
> clicked.

> If anyone has any ideas or knows how to do this I Would

> GREATLY APPRECIATE IT!

> Anyway thanks

> From

> Paul

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

--
Josef Garvi
Eden Foundation, Skreav. 45B, S-311 72 Falkenberg, Sweden
Tel: +46 346-53157, Fax: +46 346-53171
E-Mail: jo...@eden-foundation.org
WWW: http://www.eden-foundation.org/

Re:How do i get MOUSE Co-ords in Delphi 2.0


I usually do :

var cursorlastx,cursorlasty:integer;

proc onimagemousemove();
begin
 cursorlastx:=x; cursorlasty:=y;
end;

proc on imagemouseclick();
begin
 // click happend at (cursorlastx,cursorlasty)
..
end;

Rene

Quote
Paul_flu...@hotmail.com wrote:

> Thank you for taking the time to read this message..

> I am having a great amount of trouble finding a way to get the
> screen co-ords of the mouse in delphi 2.0

> I wish to ultimatly find the location in a Timage box that the mouse has been
> clicked.

Other Threads