AutoHotkey Community

It is currently May 27th, 2012, 10:04 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: COM support using Perl
PostPosted: September 12th, 2005, 4:55 pm 
Offline

Joined: May 26th, 2004, 12:20 pm
Posts: 61
Hello,

If you've played around with this, you may have already figured this out, but using thomasl's brilliant Perl integration stuff with AutoHotkey, its possible to call arbitrary methods on COM objects from AutoHotkey.

The following example sends a message to a Konfabulator widget using AHK, Perl and COM:
Code:
#Include %A_ScriptDir%\perl.ahk
PerlInit()
PerlEval(
(
"use Win32::OLE;
$k=Win32::OLE->GetActiveObject('Konfabulator.Application');
$k=Win32::OLE->new('Konfabulator.Application') if $k==undef;
$k->tellWidget('New Mail', 'close') unless $k==undef;")
)
PerlExit()


perl.ahk is the library of Perl functions included in the perlahk.zip
Win32::OLE is a standard ActiveState Perl module.
Konfabulator.Application is the COM Id of Konfabulator.
tellWidget is a method on Konfabulator's COM interface.

Have fun!

Ant.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 12th, 2005, 8:44 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
Innovative solution for achieving COM support. Thanks for sharing it.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 21 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group