Fog Creek Software
Discussion Board




I would like to correct question..

Exactly what i need is to get cursor coordinates when the mouse cursor ISN'T on the form, but when it is on the screen (desktop), or on the other applications.

P.S
I'm using Delphi 5

Mr.Donatas
Tuesday, November 26, 2002

Donatas,

The proper way to do system wide mouse-stuff is to install a Windows hook, using the SetWindowsHookEx() API.
Windows hooks are kindof hairy to work with.
You could try just putting a call to GetCursorPos() within a TTimer event, so that the mouse position gets checked on a timer. That would be alot less complex, but I dont know if it would be good enough for what you need.

Patrik
Tuesday, November 26, 2002

Have a look at TMouse too.

JaSikor
Tuesday, November 26, 2002

*  Recent Topics

*  Fog Creek Home