Retrieving selected text in Windows using Perl

R

rsreedh

Hi,

Using Win32::Clipboard, Get and Set, I can retrieve the text from the
Clipboard in Perl. But to put the text in the clipboard, we need to
wither Ctrl-C/Ctrl-V to post something into clipboard....

Is there any methods that I can call, to get the selected/highlighted
text from Windows?

Thanks
Rama
 
T

Thomas Kratz

Hi,

Using Win32::Clipboard, Get and Set, I can retrieve the text from the
Clipboard in Perl. But to put the text in the clipboard, we need to
wither Ctrl-C/Ctrl-V to post something into clipboard....

Is there any methods that I can call, to get the selected/highlighted
text from Windows?

You can control other application windows with Win32::GuiTest or
Win32::SetupSup

Thomas

--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
 
R

rsreedh

Thanks Thomas...

Can these be used to handle message queues on Windows?
I would like to use Hot keys on windows to send in selected text to a
PErl exe.. And the Perl exe will read this selected text and send an
email....

For ex, in VC++, we can call onMessage etc....

Thanks
Rama
 
T

Thomas Kratz

Thanks Thomas...

Can these be used to handle message queues on Windows?
I would like to use Hot keys on windows to send in selected text to a
PErl exe.. And the Perl exe will read this selected text and send an
email....

For ex, in VC++, we can call onMessage etc....

I'm not sure I understand what exactly you are trying to do. The modules I
mentioned are designed to simulate user input from a perl script. So you
can use them to activate a window, select text and copy it to the clipboard.

What you seem to mention above looks like the opposite: Hooking into the
system's or the application's event queue and receiving callback events
for it. Right?
I don't think there is an Win32 module for that, but you can always look
on CPAN.

Thomas

--
$/=$,,$_=<DATA>,s,(.*),$1,see;__END__
s,^(.*\043),,mg,@_=map{[split'']}split;{#>J~.>_an~>>e~......>r~
$_=$_[$%][$"];y,<~>^,-++-,?{$/=--$|?'"':#..u.t.^.o.P.r.>ha~.e..
'%',s,(.),\$$/$1=1,,$;=$_}:/\w/?{y,_, ,,#..>s^~ht<._..._..c....
print}:y,.,,||last,,,,,,$_=$;;eval,redo}#.....>.e.r^.>l^..>k^.-
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,011
Latest member
AjaUqq1950

Latest Threads

Top