Re: Delphi - Desktop event handler


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by Dragger on November 06, 2001 at 20:39:17:

In Reply to: Desktop event handler posted by Krang on October 22, 2001 at 21:58:58:

: Does enyone know how can i programming desktop event
: handler,not just form event handler but desktop event handler?I want to detekt mouse position when mouse is out of form.

You can employ the GetCursorPos function from Windows API to get the position of the cursor anywhere on the screen in absolute coordinates (relative to the upper left screen corner).
To detect mouse movement, window hook can be created, but it's a difficult procedure, you can use a timer instead. Just call the GetCursorPos function in the OnTimer event to get the mouse position on the screen.


Related Articles and Replies


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]