Results 1 to 3 of 3

Thread: GetCursorPos Error :(

  1. #1

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345
    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.
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  2. #2
    Fanatic Member
    Join Date
    Apr 2000
    Location
    Whats a location?
    Posts
    516
    Have you declared POINTAPI?

    Code:
    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]
    Courgettes.

  3. #3

    Thread Starter
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ....

    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.

    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width