Python vs VB

Ulrich Petri ulope at gmx.de
Thu May 22 15:24:20 EDT 2003


"vivek kumar" <gupt_vive at hotmail.com> schrieb im Newsbeitrag
news:mailman.1053322948.6108.python-list at python.org...
> Hi all,
>
> Like an app is running on windows (say Messanger). It has an OK button.
Now
> what You have to do is from your Python program you have to call the click
> function of that OK button widget.
>
> For this he also gave me a hint that for this U have to first get the
handle
> for that particular widget and he used some windows API for that. But as I
> was not a good student in VC++ also, so I don't know what API can be used
> for that. :-(
>

As other suggested you first need the win32all extensions.
Then you should have a look at the following API calls (you propably won't
need all of them):

GetWindow
GetDesktopWindow
GetParent
FindWindow
GetTopWindow
GetNextWindow
GetWindowText
GetWindowExtEx

and for finally clicking the Button (once you found it):

SendMessage
or
PostMessage

in conjunction with the WM_CLICK message

All the above should be documented fairly extensive on MSDN

HTH

Ciao Ulrich






More information about the Python-list mailing list