# How to control application on Windows

**URL:** <https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032>\
**Category:** Ruby\
**Created:** [October 10, 2009, 2:35am UTC](https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032 "2009-10-10T02:35:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZWZWZW](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bb73d2/32.png) [@ZWZWZW](https://www.ruby-forum.com/u/ZWZWZW)\
**Post date:** [October 10, 2009, 2:35am UTC](https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032/1 "2009-10-10T02:35:25Z")

</div>

Hi Gurus

I have an application running on Windows XP.  
How do I or can I accomplish this or is it better to use python for  
such activities

1. I like to be able to use ruby script to send mouse clicks at a  
certain location point within the application screen.
2. I like to be able to use ruby script to send signals/keys/mouse  
clicks to get to the menu  
eg File-\>Exit

Any help is appreciated.

---

<div class="post-metadata">

**Author:** ![ZWZWZW](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bb73d2/32.png) [@ZWZWZW](https://www.ruby-forum.com/u/ZWZWZW)\
**Post date:** [October 10, 2009, 6:57am UTC](https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032/2 "2009-10-10T06:57:04Z")

</div>

ZW wrote:

> Any help is appreciated.

You could try looking on [http://rubyforge.org/](http://rubyforge.org/)  
for the following gems: Win32API, Win32, and WIN32OLE

If you know your Win32 APIs then doing what you need to do from Ruby  
should be  
possible.

–  
Kind Regards,  
Rajinder Y.

[http://DevMentor.org](http://DevMentor.org)  
Do Good ~ Share Freely

---

<div class="post-metadata">

**Author:** ![ZWZWZW](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bb73d2/32.png) [@ZWZWZW](https://www.ruby-forum.com/u/ZWZWZW)\
**Post date:** [October 10, 2009, 7:58am UTC](https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032/3 "2009-10-10T07:58:57Z")

</div>

I haven’t read this book, but I would bet it could answer this and other  
questions you have.

[http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby](http://pragprog.com/titles/idgtr/scripted-gui-testing-with-ruby)

---

<div class="post-metadata">

**Author:** ![ZWZWZW](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/bb73d2/32.png) [@ZWZWZW](https://www.ruby-forum.com/u/ZWZWZW)\
**Post date:** [October 10, 2009, 12:11pm UTC](https://www.ruby-forum.com/t/how-to-control-application-on-windows/177032/4 "2009-10-10T12:11:27Z")

</div>

ZW wrote:

> Hi Gurus
> 
> I have an application running on Windows XP.  
> How do I or can I accomplish this or is it better to use python for  
> such activities
> 
> 1. I like to be able to use ruby script to send mouse clicks at a  
> certain location point within the application screen.
> 2. I like to be able to use ruby script to send signals/keys/mouse  
> clicks to get to the menu  
> eg File-\>Exit
> 
> Any help is appreciated.

That’s funny - a few minutes ago I released a new version of au3;  
looking on the new posts on the mailing list afterwards I see your post  
that just triggers the exact purpose I’ve written au3 for. So, if you’re  
using Ruby 1.9, have a look at my annotation at  
[[ANN] au3-0.1.0 released - Ruby - Ruby-Forum](http://www.ruby-forum.com/topic/197030#new) and on the project itself at  
RubyForge: [http://rubyforge.org/projects/auto/](http://rubyforge.org/projects/auto/)

Please excuse my self-promotion, but that seemed as an ideal match to  
me… 😉

Marvin
