Skip to content

Commit

Permalink
Make _WinWaitActive() more conforming
Browse files Browse the repository at this point in the history
  • Loading branch information
nurupo committed Sep 23, 2022
1 parent 8448235 commit 59f9c65
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chrome-mouse-wheel-tab-scroller.au3
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,12 @@ EndFunc

Func _WinWaitActive($windowHandle, $unused, $timeout)
Local $timer = TimerInit()
Local $activeFlag = Null
Do
Local $state = WinGetState($windowHandle)
Until BitAND($state, $WIN_STATE_ACTIVE) Or TimerDiff($timer) >= $timeout*1000
Return 1
$activeFlag = BitAND($state, $WIN_STATE_ACTIVE)
Until $activeFlag Or TimerDiff($timer) >= $timeout*1000
Return $activeFlag ? $windowHandle : 0
EndFunc

; This function might get called again in the middle if it already executing,
Expand Down

0 comments on commit 59f9c65

Please sign in to comment.