Win32::CtrlGUI

M

Mike Flannigan

I would like to do some very simple data entry with Perl.
I simply want to enter a number and hit the enter key,
the continue that for 5 or 10 numbers. An extra bonus
that is not absolutely needed to to activate an existing
window before the data is entered.

I thought I would use Win32::CtrlGUI to do this, but
surprisingly can't find it on ActiveState via ppm.

Has Win32::CtrlGUI been supplanted by something
else, or perhaps never incorporated on ActiveState?


Mike Flannigan
 
A

A. Sinan Unur

I would like to do some very simple data entry with Perl.
I simply want to enter a number and hit the enter key,
the continue that for 5 or 10 numbers. An extra bonus
that is not absolutely needed to to activate an existing
window before the data is entered.

I thought I would use Win32::CtrlGUI to do this, but
surprisingly can't find it on ActiveState via ppm.

Googling did not help either. Hmmm ... I guess you could try compiling it
yourself using the free VC7 compiler and the platform SDK. It worked like a
charm in my case.
Has Win32::CtrlGUI been supplanted by something
else, or perhaps never incorporated on ActiveState?

You could also give GuiTest a shot:

use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys);

system('start notepad test.txt') == 0
or die "system failed: $?";

sleep 1;

my $w = shift @{[ FindWindowLike(undef, '^test.txt - Notepad$') ]};

SetForegroundWindow($w);
SendKeys("$_~") for (1 .. 10);

__END__
 
M

Mike Flannigan

A. Sinan Unur said:
Googling did not help either. Hmmm ... I guess you could try compiling it
yourself using the free VC7 compiler and the platform SDK. It worked like a
charm in my case.

Yeah, I tried Google too.
There is a ton of stuff, but nothing about why it's not
on ActiveState.

In fact this site indicates it is (was) on ActiveState:
http://aspn.activestate.com/ASPN/Modules?module_name=W&order=name


Well I take that back. This site indicates the module is
not available on ANY platform:
http://ppm.activestate.com/BuildStatus/5.6-W.html
I guess that's the way to interpret that page.


You could also give GuiTest a shot:

use Win32::GuiTest qw(FindWindowLike SetForegroundWindow SendKeys);

system('start notepad test.txt') == 0
or die "system failed: $?";

sleep 1;

my $w = shift @{[ FindWindowLike(undef, '^test.txt - Notepad$') ]};

SetForegroundWindow($w);
SendKeys("$_~") for (1 .. 10);

__END__

I think I will try GuiTest.

I sure appreciate the help.


Mike
 

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

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,422
Latest member
LatashiaZc

Latest Threads

Top