GoBlue_MathMan
GoBlue_MathMan

Reputation: 1148

Using PyWinAuto to control a currently running application

Using the following code I can find that the currently running window I want to connect is named "Trade Monitor" how do i successfull connect to it? Using the app.start_ method does not work.

from pywinauto import application
app=application.Application
app.findwindows #prints all windows running on machine

app.window("Trade Monitor") #error

Upvotes: 11

Views: 29502

Answers (2)

General4077
General4077

Reputation: 457

For anyone else who ended up here, the connect method @Vasily Ryabov mentioned works for PIDs too. Double Thanks to him as the docs he linked explain that.

app = Application().connect(process=1234, timeout=5)

Upvotes: 0

Vasily Ryabov
Vasily Ryabov

Reputation: 10000

Just use app = Application().connect(title='Trade Monitor', timeout=10). More detailed info is in the docs here.

Upvotes: 18

Related Questions