Jump to content

Bug Discovered in WinWaitClose (I think)


Recommended Posts

I'm pretty sure I've discovered a bug in the WinWaitClose function when WinSetTitleMatchMode is set to 2. Here's a confirmation script that demonstrates what I'm talking about by using IrfanView's Palette entries window and Color subwindow.

#cs

This script demonstrates that there is an error in the way

3.0.103.0 finds windows during the WinWaitClose function when

WinTitleMatchMode is set to 2.

It first launches IrfanView (a common freeware graphic viewer)

with a graphic.

Then, it opens a child window called "Palette entries" and waits

for the user to close it. This always detects things properly.

Finally it opens a child window called "Color" which is a child

of the Palette window. The script detects that this window exists

and is active, but the script always fails to detect when this

window closes.

#ce

; PATH TO THE IRFANVIEW IMAGE VIEWER PROGRAM

$irfanViewPath = 'C:\Program Files\Accessories\IrfanView\i_view32.exe'

; PATH TO A GIF IMAGE WITH 16 COLORS (MUST BE AN IMAGE WITH 256 OR FEWER COLORS)

$picturePath = 'c:\trash\jeff16.gif'

Run($irfanViewPath & ' ' & $picturePath)

AutoItSetOption ( "WinTitleMatchMode", 2 )

AutoItSetOption ( "MouseCoordMode",0)

WinActivate('IrfanView')

WinWaitActive('IrfanView')

Send('!iee')

WinWaitActive('Palette entries','')

MsgBox(0,'','Now close the Palette entries window.')

WinWaitClose('Palette entries','')

MsgBox(0,'','Palette Window Closed')

Send('!iee')

WinWaitActive('Palette entries','')

MouseClick('left',15,34,2,0)

WinWaitActive('Color','')

MsgBox(0,'','Now close the Color window.')

If WinWaitClose('Color','',5) Then

MsgBox(0,'','Color Window Closed!')

Else

MsgBox(0,'','Could not detect closed window after 5 seconds')

EndIf

Link to comment
Share on other sites

  • Developers

I'm pretty sure I've discovered a bug in the WinWaitClose function when WinSetTitleMatchMode is set to 2. Here's a confirmation script that demonstrates what I'm talking about by using IrfanView's Palette entries window and Color subwindow.

<{POST_SNAPBACK}>

Works for me..

Are you closing the MSGBOX before closing the palette window ?

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Works for me..

Are you closing the MSGBOX before closing the palette window ?

<{POST_SNAPBACK}>

It doesn't work for me either way. I'm bouncing my Windows 2000 Pro machine to see if that's somehow the problem. I regressed back to .102.0 and the problem persisted, so I'm trying a reboot.

If it wasn't for AutoIt, I think I'd hate windows :-)

Link to comment
Share on other sites

  • Developers

It doesn't work for me either way. I'm bouncing my Windows 2000 Pro machine to see if that's somehow the problem. I regressed back to .102.0 and the problem persisted, so I'm trying a reboot.

If it wasn't for AutoIt, I think I'd hate windows :-)

<{POST_SNAPBACK}>

Are you getting the MsgBox(0,'','Could not detect closed window after 5 seconds')

message?

If so add these statements to see which window it sees:

MsgBox(4096,"debug", WinGetTitle("Color"))

MsgBox(4096,"debug", WinGetText("Color"))

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Are you getting the MsgBox(0,'','Could not detect closed window after 5 seconds')

message?

If so add these statements to see which window it sees:

MsgBox(4096,"debug", WinGetTitle("Color"))

MsgBox(4096,"debug", WinGetText("Color"))

<{POST_SNAPBACK}>

After a reboot, it seems to work. What's the deal with that?
Link to comment
Share on other sites

After a reboot, it seems to work. What's the deal with that?

<{POST_SNAPBACK}>

In a situation like that, my colleagues say:

That's Windows

Don't expect Windows to behave the same, everytime.

A reboot of the computer usually solves it.

I don't know if it's typical Windows-behaviour or the RAM (memory) is cluttered.

Link to comment
Share on other sites

  • Developers

After a reboot, it seems to work. What's the deal with that?

<{POST_SNAPBACK}>

Any window with the word "close" in the title would give you this problem... even when it is hidden...

thats why i suggested to retrieve the windowtitle and text when you have this issue again... this might give you a clou...

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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...