# Win32OLE question

**URL:** <https://rubytalk.org/t/win32ole-question/11710>\
**Category:** ruby-talk\
**Created:** [24 May 2004 14:10 UTC](https://rubytalk.org/t/win32ole-question/11710 "2004-05-24T14:10:34Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Shashank\_Date4](https://avatars.discourse-cdn.com/v4/letter/s/46a35a/32.png) [@Shashank\_Date4](https://rubytalk.org/u/Shashank_Date4)\
**Post date:** [24 May 2004 14:10 UTC](https://rubytalk.org/t/win32ole-question/11710/1 "2004-05-24T14:10:34Z")

</div>

Hi Tim,

> I’m not the original poster, but I’ve done something  
> like this. I didn’t use  
> Win32OLE though, I used Win32 calls. (Easy thanks to  
> the ‘dl’ library.)

Great !

> There’s a program called “Winspector”  
> ([www.windows-spy.com](http://www.windows-spy.com)) which allows you  
> to see what messages are sent to a window when you  
> do things. (Like click a  
> button.) You can simulate user-actions by sending  
> these same messages.  
> (Microsoft has a similar program called Spy++ which  
> they distribute with  
> Visual Studio.)

Yes, I have used Spy++ in the past …

> I gave a talk about this once, slides are at

[http://www.sdkacm.com/static/events/12-March-2004/slides.sxi](http://www.sdkacm.com/static/events/12-March-2004/slides.sxi)

> ([OpenOffice.org](http://OpenOffice.org) format).
> 
> I’m not sure how useful the slides will be, many of  
> them just say things  
> like “[demonstrate code that does …]”, and I  
> don’t have the demonstrations  
> online.

I will check it out.

> I’ll ask work if I can release the code I wrote  
> under a nice license  
> (BSD/MIT-style). They’ve previously done this for  
> code that’s not directly  
> related to our project, so there’s a good chance we  
> can do this. (It may take a little while …)

No problem … I will wait 🙂

> Feel free to ask me if you have any questions about  
> this.

Just a simple example of grabbing the Active window  
and sending a message (e.g. Maximize) in Ruby may be?

I have been able to do it for applications that are  
started from within my Ruby app (using Win32Ole and  
Shell.sendkeys interface), but not for those that are  
already running.

Thanks,  
– shanko

> **···**
>
> — Tim Sutherland [timsuth@ihug.co.nz](mailto:timsuth@ihug.co.nz) wrote:
> 
> * * *
> 
> Do you Yahoo!?  
> Yahoo! Domains  Claim yours for only $14.70/year  
> [http://smallbusiness.promotions.yahoo.com/offer](http://smallbusiness.promotions.yahoo.com/offer)
