Jump to content

WinWait can not find Notepad (Kladblok) window


tim167
 Share

Recommended Posts

:P

I have set

AutoItSetOption('WinTitleMatchMode', 2)

to match a substring in the window title

then I try do look for an open Kladblok (=Notepad) window using:

AutoItSetOption('WinTitleMatchMode', 2)

Auto.WinWait('Kladblok')

I also tried :

Auto.WinWaitActive('Kladblok')

Auto.WinWait('', 'Kladblok')

Auto.WinWait('Kladblok')

but it always fails...

the actual title of the window is something like :

'outF5.tmp - Kladblok'

where 'out' and '.tmp - Kladblok' are constant, the 'F5' can vary every time.

btw:

I'm controlling AutoitX3 from python via win32com.client.

How can I effectively capture this beast?

thanks!

Tim

Edited by tim167
Link to comment
Share on other sites

i also tried window matching mode 4 and using 'classname=Notepad'

no luck either...

here's the what the Autoit info window says about the Kladblok window:

>>>>>>>>>>>> Window Details <<<<<<<<<<<<<

Title: outE4.tmp - Kladblok

Class: Notepad

Size: X: 16 Y: 23 W: 828 H: 349

>>>>>>>>>>> Mouse Details <<<<<<<<<<<

Screen: X: 251 Y: 230

Cursor ID: 5

>>>>>>>>>>> Pixel Color Under Mouse <<<<<<<<<<<

RGB: Hex: 0xFFFFFF Dec: 16777215

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X: 0 Y: 0 W: 820 H: 301

Control ID: 15

ClassNameNN: Edit1

Text:

>>>>>>>>>>> Status Bar Text <<<<<<<<<<<

(1):

(2): Ln 1, Col 14

>>>>>>>>>>> Visible Window Text <<<<<<<<<<<

*** ready ***

>>>>>>>>>>> Hidden Window Text <<<<<<<<<<<

Need help!!

Thanks,

tim

Link to comment
Share on other sites

  • Moderators

This may seem like a silly question... But your using Auto.WinWait(), just to clarify, your trying to use the AutoItX3.dll with another language?

If so, did you open it before you did your calls, this I've found to be a common mistake?

If not, then you don't need the Auto.WinWait(), you only need WinWait().

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Hi, Thanks for your reply,

'your trying to use the AutoItX3.dll with another language?'

Yes I use Auto.WinWait(....

..sorry I thought I already said that, I'm driving AutoIt from Python.

I solved it finally, it cost me 2 hours...and I'm still not shure what was wrong.

I also restarted my computer, because I thought maybe there was something running in the background that interfered with my program...just a wild guess...

Finally this worked for me:

Auto.AutoItSetOption('WinTitleMatchMode', 2)
wworesult=Auto.WinWait('tmp')
if not wworesult:
  print 'resultwin not open'
Auto.WinClose('tmp')
Auto.WinWaitClose('tmp')

'tmp' is a constant element in the middle of the window title.

If i remember correctly I also tried to match 'Kladblok' with the same AutoItSetOption setting, but couldn't get it to work.

Is it possible that with ('WinTitleMatchMode', 2) WinWait reacts only when the match is a substring somewhere in the middle and so doesn't work when the match is at the end or the beginning?

anyway my little script works so I'm happy :P

Edited by tim167
Link to comment
Share on other sites

  • Moderators

Now: Auto.AutoItSetOption('WinTitleMatchMode', 2)

Before: AutoItSetOption('WinTitleMatchMode', 2)

Admittingly, I've never played with the .dll. I'm happy you got it to work for you because I would have not known that.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...