Mouse click with win32api

E

Emil Sandin

Hi,
I would like to write a script like this:

mouse.move_cursor_to( x, y )
mouse.click_left_button()

I have read that I can use AutoIt, but that the program has to have an
ole interface for it to be possible. That autoit doesn't really move the
mouse cursor, but rather tells the program to click a certain
coordinate.

Is it possible to do this using win32api instead of autoIt, or is there
another neat way of acheive it?

Regards
Emil
 
E

Emil Sandin

Emil said:
Hi,
I would like to write a script like this:

mouse.move_cursor_to( x, y )
mouse.click_left_button()

I have read that I can use AutoIt, but that the program has to have an
ole interface for it to be possible. That autoit doesn't really move the
mouse cursor, but rather tells the program to click a certain
coordinate.

Is it possible to do this using win32api instead of autoIt, or is there
another neat way of acheive it?

Regards
Emil

Sorry, I was to fast to create a post.
AutoIt seems to do the trick for me:

gem install watir
regsvr32 C:\ruby\lib\ruby\gems\1.8\gems\watir-1.4.1\watir\AutoItX3.dll
irb
require 'rubygems'
require 'win32ole'
a = WIN32OLE.new("AutoItX3.Control")
a.mousemove(100, 100)
a.mouseclick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top