Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Interact with another program (ala VB)?

by EvanK (Chaplain)
on Aug 15, 2001 at 02:45 UTC ( #104906=perlquestion: print w/ replies, xml ) Need Help??
EvanK has asked for the wisdom of the Perl Monks concerning the following question:

Is there any way for me to, on a win32 operating system, interact with another program's gui in Perl? or more specifically, to interact with the AOL gui the same way one could using Visual Basic? any help would be greatly appreciated

Douglas Noel Adams
1952 - 2001

Comment on Interact with another program (ala VB)?
Replies are listed 'Best First'.
Re: Interact with another program (ala VB)?
by HamNRye (Monk) on Aug 15, 2001 at 03:14 UTC

    Yes, it is possible using either Win32::OLE or some of the built-ins of the active state distro. (use OLE;)

    use OLE; $ActiveSession = CreateObject OLE "MAPI.Session" || die "CreateObject: $!"; $Message = $ActiveSession->Outbox->Messages->Add(); $Recipient = $Message->Recipients->Add(); $Recipient->{Name} = "Erik Olson"; # to address $Recipient->{Type} = 1; # ugly constant, means this is a To address $Recipient->Resolve(); # resolve name - hope it's there $Message->{Subject} = "A Message From Perl"; $Message->{text} = "Perl does automation!"; $Message->Update(); # save it $Message->Send(1, 0, 0); # send it - don't show UI $ActiveSession->Logoff(); # end session

    This code is from learning Perl on Win32 systems. It should give you an idea how this all works.

    Once you find the Object defs for the AOL client, you should be golden.

      thanks a bunch, now i just need to find those object definitions...

      Douglas Noel Adams
      1952 - 2001

        The object defintions are documented somewhere or another by Microsoft, and the typelib is self-describing and there are programs to browse it. In my experience, it takes both to figure out Office because the docs are incomplete from a technical point, and the defs don't tell you what the function is really for.

        You might look at Win32::OLE Browser in the local docs. For me, it is :


        Not that it has tons of documentation for the objects (dunno if it even has the AOL objects), but it's pretty cool. It actually browses objects from the web page.

Re: Interact with another program (ala VB)?
by jplindstrom (Monsignor) on Aug 15, 2001 at 14:50 UTC
      Yeah! thanks a lot, that GuiTest module is gonna work perfect.

      Douglas Noel Adams
      1952 - 2001

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://104906]
Approved by root
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2015-10-09 01:05 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (232 votes), past polls