This will print the text from any open Notepad window.
See Win32::GuiTest and Win32::Clipboard.
update1: removed a debugging print statement#!/usr/bin/perl use warnings; use strict; use Win32::GuiTest qw[FindWindowLike SendKeys SetForegroundWindow]; use Win32::Clipboard; my $clip = Win32::Clipboard(); for my $w (FindWindowLike(undef, qr{ - Notepad$}, undef, undef, undef) +){ SetForegroundWindow($w); SendKeys(q{^A^C}); print $clip->Get(); }
In reply to Re: Copy text from a window
by wfsp
in thread Copy text from a window
by Jon99
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |