java.awt.Robot equivalent?

  • Thread starter Christopher Koppler
  • Start date
C

Christopher Koppler

I need to simulate mouseclicks (in Win2K) in another application's
window. Googling threw up java.awt.Robot, and a bit of trial and error
showed that it could do what I needed (simulate a mouseclick on an
open window). However, I don't want to use Java (or Jython) if I can
avoid it, as I already have a Python 2.3 app, which works quite
nicely, thank you, and which needs to click into a foreign window.

Is this capability available in any of the GUI toolkits (searching
Tkinter docs brought up nothing)? Is there a C library that I could
wrap? Or maybe I just need to use the Windows extensions. But if so,
how - I don't have the slightest idea how that would work.

Anyone have any pointers?
 
F

Fredrik Lundh

Christopher said:
Is this capability available in any of the GUI toolkits (searching
Tkinter docs brought up nothing)? Is there a C library that I could
wrap? Or maybe I just need to use the Windows extensions. But if so,
how - I don't have the slightest idea how that would work.

Anyone have any pointers?

win32api's PostMessage might be useful. random google link:

http://mail.python.org/pipermail/python-win32/2002-December/000635.html

</F>
 
C

Christopher Koppler

Other random resources:

Simon Brunning has written a 3-part details blog entry on
'automating the win32 gui'.

And there's a library named 'autoit' which can be driven by com.

<accent type="fake Finnish rock'n'roll">
Thank you very many, Fredrik, Thomas!
</accent>

Autoit does exactly what I need (click on a specific coordinate in a
canvas-like window), and finally a reason to learn to use ctypes,
too...
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top