PDA

Click to See Complete Forum and Search --> : GetCursorPos Error :(


honeybee
Jul 28th, 2000, 06:30 AM
I think this is my first post on the API forum. Anyway.

I have a form with some controls like listbox, textbox etc. I want to allow the user to move the controls around the form anyway he likes. For this purpose, what I want to do is whenever the user right-clicks on a control, the control becomes moveable and I want to position the mouse pointer on the left-top corner of the control. For this I used SetCursorPos API, passing the Control.Left and Control.Right as parameters. It positions the cursor somewhere else, but it is outside the form. Is this position relative to the active form or the screen?

Also I used GetCursorPos API to track the position of the mouse pointer. It gives an error 'User defined type not defined'. What is wrong? I have pasted the declaration from the API viewer.

Thanks in advance for help/no help.

V(ery) Basic
Jul 28th, 2000, 07:10 AM
Have you declared POINTAPI?


Type POINTAPI
x As Long
y As Long
End Type


V(ery)'s Basic tip:

To make what you're doing easier use ClientToScreen for SetCursorPos API and ScreenToClient for GetCursorPos

[Edited by V(ery) Basic on 07-28-2000 at 08:12 AM]

honeybee
Jul 28th, 2000, 09:32 PM
Thanks a lot, friend.

Actually this is the point I entirely misunderstood. I did not know how to declare the POINTAPI type. I shall try and if faild, come back to you.

Thanks again.