From: psoares at consiste.pt (Paulo Soares)
Date: Mon, 17 May 1999 16:40:00 GMT
Subject: Scripting Windows GUI application with Python (SendKeys)
Message-ID: <51998F46F8B7D011BF7C0060B03502AD0EA990@orion.consiste.pt>
Content-Length: 1558
X-UID: 1929                                                 

The WIN32 API function to send keys to an application that has the focus
is keybd_event in win9X/NT and SendInput in win98/NT.
You can also have a look at John Robbins' Feb '99 Microsoft Systems
Journal Bugslayer Column where he describes a way to parse the keys as
Visual Basic does.
I have altered this code to provide very simple scripting to a tape
backup procedure.
I can send it if you want it. Is is written in Visual C++ 6.0 but it is
trivial to extract the needed parts and make a python extension.

Best Regards,
Paulo Soares

> -----Original Message-----
> From:	Christian Lemer [SMTP:Christian.Lemer at usrconsult.be]
> Sent:	Monday, May 17, 1999 15:12
> To:	python-list at cwi.nl
> Subject:	Scripting Windows GUI application with Python (SendKeys)
> 
> Dear all,
> 
> Currently we use WinBatch to automate some tests and productions
> application under Windows NT.
> 
> One year ago, we switched from Perl to Pyton as script language under
> unix.
> 
> I wonder if it is possible to drive a Windows GUI application (using
> keybord commands) like it is possible in Winbatch with Python under
> Windows?
> 
> I installed also the windows extensions but couldn't find the correct
> way to send a key to an application.
> 
> Thanks in advance for your help.
> 
> Chris.
> 
> -- 
> Christian LEMER                                    tel +32.10.65.44.11
> UsrConsult S.P.R.L                                 fax +32.10.65.44.10
> rue Margot, 37
> http://www.usrconsult.be
> B-1457 Nil St Vincent             mailto:Christian.Lemer at usrconsult.be




