Jump to content

WinWait by CLASS with embedded brackets or by position


Recommended Posts

VIPRE antivirus pops up obnoxious windows for every stupid thing they do... "stopped some adware"... "running a scan"... etc.

The reason they are obnoxious is that they grab focus and set themselves on top of the z-order. So I would like to kill them as soon as they appear.

These windows have no TITLE - their CLASS has embedded brackets - the CLASS content changes for each instance - but the position is always the same.

;~ >>>> Window <<<<
;~ Title:
;~ Class:    HwndWrapper[DefaultDomain;;a6efc34a-c4a7-4982-83c3-9a0d91ee4310]
;~ Position:    582, 50
;~ Size:    448, 98
;~ Style:    0x16080000
;~ ExStyle:    0x00080008
;~ Handle:    0x00000000000E188E

;~ >>>> Window <<<<
;~ Title:
;~ Class:    HwndWrapper[DefaultDomain;;7ae0f835-68a7-4bde-93e4-17a78ad4ff53]
;~ Position:    582, 50
;~ Size:    448, 98
;~ Style:    0x16080000
;~ ExStyle:    0x00080008
;~ Handle:    0x00000000000518BA

I have tried Opt("WinTitleMatchMode", 2)  for subStr matching using:

WinWait( "[CLASS:HwndWrapper[DefaultDomain;;]")

WinWait( "[CLASS:HwndWrapper]")

But I get no match with any of those.

I've also tried matching by window position - but I don't think any of my attempts at the syntax have been correct

WinWait( "582\50\448\98")

WinWait( "X:582; Y:50; W:448; H:98")

Local $aWaitPos[4] = [582, 50, 448, 98]
WinWait( $aWaitPos)

Any ideas on how to capture these windows?

Thanks!

Link to comment
Share on other sites

53 minutes ago, Nine said:

Uninstall bad AV - install good AV ?

If we record your handle three times and play it backwards - does it say "Paul is dead"?

I was actually hoping for a useful AutoIT based answer. [smile]

Link to comment
Share on other sites

Personally, I would never use WinWait() in that way to wait for a window to appear. I would use code as in the first post here. When a window popup is detected, then I would test if it's the right window. With this technique you can use real regular expressions to test the window title. And you avoid your script being blocked by WinWait(), so you can use the same script for many other tasks simultaneously.

Link to comment
Share on other sites

17 hours ago, cbruce said:

If we record your handle three times and play it backwards - does it say "Paul is dead"?

Nice reference with Number Nine - Congrats :)

But using Larsj suggestion you would need to use _WinAPI_GetClassName ($lParam) since there is no title on your pop-up windows. Then you can use a simple StringInStr to check if it is the right window, and close it...

Edited by Nine
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...