[lazarus] GetFormRelativeMousePosition, GetCaretPos?

Marc Weustink marc at dommelstein.net
Sun Jul 27 12:41:56 EDT 2003


At 18:59 27-7-2003 +0200, Micha Nelissen wrote:
>Marc Weustink wrote:
>
>>At 17:50 27-7-2003 +0200, Micha Nelissen wrote:
>>
>>>Hi,
>>>
>>>In the IDE designer these (see subject) two functions are used to 
>>>determine the mouse position?
>>
>>??? GetCaretPos hasn't anything to do with a mouse, so I don't think it 
>>is used.
>
>I thought so too, but check GetFormRelativeMousePosition in designerprocs.pas.

I guess that is a typo. GetCaretPos should have been GetCursorPos

Fixed that.

>>>AFAIK, there is no caret on a form and on windows GetCaretPos returns 
>>>the client position of the caret of whatever it currently is in. Please 
>>>explain.
>>
>>The Caret (on windows) is system wide. There is only one Caret (that's 
>>why you don't have to specify a handle in GetCaretPos) and it is per def. 
>>in the currently focused window.
>
>The strange thing is that the form origin is subtracted from it, but since 
>GetCaretPos is client relative position, this can never give a correct result.

Indeed, but GetCaretPos shouldn't been used there anyway.

Marc






More information about the Lazarus mailing list