From: James L. <jl...@bi...> - 2002-07-05 16:24:15
|
Hi Marcus, Forgot to say that in VB one could use the built in SendKeys VB function to send the keystrokes. Not sure how one can achieve this in Perl and/or wxWindows - ideas, anyone? Oh - found this by doing a Google groups search for "perl sendkeys" vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv #!/usr/local/bin/perl -w use Win32::OLE; my $objPerlCOM = new Win32::OLE("WScript.Shell") || die "Can't create PerlCOM object\n"; Of course you'll need the Windows Script Host installed. $objPerlCOM->AppActivate(377); As I'm sure you'll know, put the correct pid here. For me, I opened up notepad and found its pid to be 377 at that time. $objPerlCOM->SendKeys('abcdef'); sleep 4; $objPerlCOM->SendKeys('%fx'); ^^^^^^^^^^^^^^^^^^^^ Thanks to jimbo (ji...@so...) for this! I haven't tried the above, so can't guarantee it works - but there were several other promising threads resulting from the above search. James ----- Original Message ----- From: "Marcus" <li...@wo...> To: <wxp...@li...> Sent: 05 July 2002 13:34 Subject: [wxperl-users] Get Window by name > Does anybody know how to get a window by name? > > I'm working on the following: I have a dialog which collects user input > which needs to be pasted to an application of the user's choice. I > think I need to get the Window by name, e.g. "Notepad", or "Some > application", then copy and paste via the clipboard. To paste I need to > make the application's window active. > > Any ideas if there's a way in Perl? > > Thanks, > > Marcus > > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Bringing you mounds of caffeinated joy. > http://thinkgeek.com/sf > _______________________________________________ > wxperl-users mailing list > wxp...@li... > https://lists.sourceforge.net/lists/listinfo/wxperl-users |