- Run ppm (the perl package manager)
- Type 'install Win32::GuiTest'
- Add the following code to your perl script:
use Win32::GuiTest qw(IsWindow FindWindowLike SendKeys
(Note that each function you need to call should be listed in this enum-- I've listed the most common ones
PushButton SetActiveWindow SetForegroundWindow GetWindowRect MouseMoveAbsPix SendMouse); - Bring your window to the foreground:
sub bring_window_to_front {
my $window = shift;
my $success = 1;
if ( SetActiveWindow($window) ) {
print "* Successfully set the window id: $window active\n";
}
else {
print "* Could not set the window id: $window active\n";
$success = 0;
}
if ( SetForegroundWindow($window) ) {
print "* Window id: $window brought to foreground\n";
}
else {
print "* Window id: $window could not be brought to foreground\n";
$success = 0;
}
return $success;
}
Monday, May 11, 2009
Loading Perl's Win32::GuiTest
The Win32::GuiTest allows perl scripts run under Windows to send keyboard and mouse events to Win32 programs. George Nistorica wrote an article on how to do this; I've summarized what you need to do here.
Subscribe to:
Post Comments (Atom)
Labels
- Java (34)
- Oracle (27)
- javascript (24)
- NIX administration (19)
- Reporting (18)
- XML (17)
- Web Graphics (10)
- perl (10)
- CSS (9)
- Tomcat (8)
- Android (7)
- Matlab (7)
- XSL (7)
- HTML (6)
- SQL (6)
- XForms (6)
- browser quirks (6)
- Orbeon XForms (5)
- Solaris (5)
- AJAX (4)
- Mirth Project (4)
- PHP (4)
- Video (4)
- Arduino (3)
- Eclipse (3)
- JPA (3)
- JSP (3)
- JSTL (3)
- LAMPS (3)
- SSH (3)
- SVN (3)
- Hibernate (2)
- Netbeans (2)
- Networking (2)
- Python (2)
- Windows (2)
- Wordpress (2)
- XHTML (2)
- Alfresco (1)
- Architecture (1)
- ArduPilot (1)
- Arduino Yun (1)
- Arduplane (1)
- Audio Recording (1)
- Betaflight (1)
- CouchDB (1)
- DIY (1)
- Design (1)
- FPV (1)
- JSON (1)
- JUnit (1)
- Mobile Development (1)
- Printing (1)
- RC Airplane (1)
- REST (1)
- Scalability (1)
- Struts (1)
- Tools (1)
- Virtualization (1)
- Web services (1)
- camera (1)
- canon (1)
- gphoto2 (1)
- jQuery (1)
- ubuntu (1)
- unix (1)
No comments:
Post a Comment