VB6, Control the Mouse?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: VB6, Control the Mouse?

  1. #1
    Join Date
    Jun 2005
    Location
    Wouldn't YOU Like to know??
    Posts
    26

    VB6, Control the Mouse?

    Is there any alternate way to control the mouse, other than use AutoItX3? (I tried AIX3, but it is having some problems with the clicking and it cannot double click.)
    Are there other ways to have the mouse automatically controlled? I need to have the mouse move at an X, Y location, and have the ability to click, and double click.
    Are there any other Controls that can be added, (.dll, or .ocx), or files that I can Add Reference to and use in my code.
    I can manage with intermediate code, and advance Visual Basic. I have taught myself the language and know it well enough.
    Please reply soon, I want to finish my current project.
    Thank you,
    -- Drakenza
    ...I have arrived, to attempt to conquer the world with my nefarious schemes!!! You. All of you!! You shall all bow... bow, to ME!!!!

    MUWAHAHAHAHAHA!!!!!!!!!

  2. #2
    Join Date
    Jun 2005
    Location
    Wouldn't YOU Like to know??
    Posts
    26
    Of course, if anyone could give me help with my clicking problems in AutoItX3, that would be fine too.
    ...I have arrived, to attempt to conquer the world with my nefarious schemes!!! You. All of you!! You shall all bow... bow, to ME!!!!

    MUWAHAHAHAHAHA!!!!!!!!!

  3. #3
    Join Date
    Jun 2005
    Location
    On a computer
    Posts
    4

    Mouse Problems

    If you are just wanting to move the mouse then use the API function below:

    Declare Function SetCursorPos Lib "user32" Alias "SetCursorPos" (ByVal x As Long, ByVal y As Long) As Long

    other then that i can't help ya

  4. #4
    Join Date
    Nov 2003
    Location
    Alameda, CA
    Posts
    1,737
    This is from one of my favourites, Karl E. Peterson:

    http://vb.mvps.org/samples/project.asp?id=mouseevent

    Marco
    "There are two ways to write error-free programs. Only the third one works."
    Unknown

  5. #5
    Join Date
    Jun 2005
    Location
    Wouldn't YOU Like to know??
    Posts
    26

    Cool

    Thanks to both of you, that helps. I already know how to move the mouse, and the project... I'll check it out. If I have any trouble, I'll post it here.
    Thanks!
    I posted that before (I quote because don't like to double post).
    I do have another problem. I put this code in my general declarations.

    Code:
    Private Mouse as CMouseEvent
    Now if I try to use my MouseEvents in other parts of my code, I get the following error:
    Runtime error '91':
    Object variable or With block variable not set.
    Here is an example of how I'm using CMouseEvents.

    Code:
    Mouse.MoveTo X, Y
    Where X and Y are some values.

    Am I coding wrong? This is my first time using CMouseEvents (from the link posted above). If anyone could help, please do!

    Thank you,
    --Drakenza
    Last edited by Drakenza; 06-14-2005 at 06:40 PM.
    ...I have arrived, to attempt to conquer the world with my nefarious schemes!!! You. All of you!! You shall all bow... bow, to ME!!!!

    MUWAHAHAHAHAHA!!!!!!!!!

  6. #6
    Join Date
    Nov 2004
    Location
    Huddinge, Sweden
    Posts
    283
    You have not created an instance of CMouseEvent:

    Code:
    Set Mouse = New CMouseEvent
    Rune
    If you hit a brick wall, you didn't jump high enough!

  7. #7
    Join Date
    Jun 2005
    Location
    Wouldn't YOU Like to know??
    Posts
    26
    Quote Originally Posted by Rune Bivrin
    You have not created an instance of CMouseEvent:

    Code:
    Set Mouse = New CMouseEvent
    Rune
    Fantastic. Thanks!! My application works great now.
    ...I have arrived, to attempt to conquer the world with my nefarious schemes!!! You. All of you!! You shall all bow... bow, to ME!!!!

    MUWAHAHAHAHAHA!!!!!!!!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center