Page 1 of 1

Posted: Tue Jul 16, 2002 4:56 am
by BackupUser
Restored from previous forum. Originally posted by stede.

I want to plot a point at the EXACT position of the mouse pointer. When I use WindowMouseY() I seem to be getting the point at +30 the mouse position. I am using Windows XP.

Stede

Posted: Tue Jul 16, 2002 7:49 am
by BackupUser
Restored from previous forum. Originally posted by fweil.

'Pointer position' has to be understood with some extra things :

- depends on the cursor you use
- depends on the window parameters you have

When getting WindowMouseX() and WindowMouseY() if your window has borders and other side effects, you may want to get not the cursor position in the window but inside the user area of it.

This means that you have to substract top and left edge pixels from location returned by WindowMouse functions.

Also when using an arrow as a cursor, the accurate position corresponds to the end of the arrow while when using a crosshair it is in the middle of the cursor.

Usually cursors are made so you don't have too much trouble to know the exact pixel difference between the cursor and the user target (it is often intuitive).

Best is to make tests before providing your software to users. Also you may encounter some more issues when using different OS versions because windows are not exactly handled in the same way on 98/ME/XP/2K ...

I noticed some days ago this kind of issue about minimum size of windows, but there are also some possible differences concerning the window border thickness.

It is a fact that using Windows API you can get all metrics information including such details like window border thickness etc ... but I consider it is a mess.

Francois Weil
14, rue Douer
F64100 Bayonne