in reply to Perl+MSWord (via Win32::OLE) events handling

Do you by asking:
Does anyone knows a way how to send to my program any type of signal in my case?
mean that you want to send a message to Word, that gets processed by the message loop in your perl program?

If so, you could try:
#!/usr/bin/perl -w use Win32::API; my $find = new Win32::API("user32", "FindWindowA", 'PN', 'N') or die "No find"; my $send = new Win32::API("user32", "SendMessageA", 'NNNN', 'N') or die "No send"; # Find any Word window my $wordhandle=$find->Call("OpusApp",0); print "Handle: ",$wordhandle,"\n"; $send->Call($wordhandle, 0x0010, 1, 0) if ($wordhandle);
This should close Word and generate a "Quit" event.


/brother t0mas

Replies are listed 'Best First'.
Re: Re: Perl+MSWord (via Win32::OLE) events handling
by Courage (Parson) on Sep 26, 2002 at 14:55 UTC
    In a few words, I meant following idea:

    I am able to communicate from Perl to MS-Word.

    I want to be able to do reverse communication as well, notify my perl script of my event, give it processor ticks

    Thank you for your help which contained interesting ideas
    Courage, the Cowardly Dog