in reply to Copy text from a window
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(); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Copy text from a window
by Jon99 (Initiate) on Mar 03, 2009 at 16:34 UTC | |
by wfsp (Abbot) on Mar 03, 2009 at 16:52 UTC | |
by Jon99 (Initiate) on Mar 03, 2009 at 23:14 UTC | |
by wfsp (Abbot) on Mar 04, 2009 at 06:13 UTC | |
by Jon99 (Initiate) on Mar 04, 2009 at 12:22 UTC |