Jump to content

Recommended Posts

Posted

Below is what I want to auto close if it pops up.

http://tinypic.com/fullsize.php?pic=20r0h6...;capwidth=false

I have tried:

Opt("WinTitleMatchMode", 3); This makes sure the window name is an exact match
    If WinExists("Microsoft Windows", "&Close program") Then
        WinKill("Microsoft Windows", "&Close program")
    EndIf

&

WinClose("[CLASS:#42770]", "")

&

$Handle = WinGetHandle("[TITLE:Microsoft Windows; [CLASS:#42770]", "")
WinClose($Handle)

&

$Handle = WinGetHandle("Microsoft Windows", "")
WinClose($Handle)

&

WinKill("Microsoft Windows")

Nothing I did would close this stubburn window!

Posted (edited)

Welcome,

Thanks for the picture but it is not showing enough information for me to come to some solution without guessing.

I would try this

Opt("WinTitleMatchMode", 3); This makes sure the window name is an exact match
If WinExists("Microsoft Windows", "&Close program") Then
    ; Check if the window is visible
    If BitAND(WinGetState("Microsoft Windows", "&Close program"), 2) Then
        ControlClick("Microsoft Windows", "&Close program", "&Close program")
    EndIf
EndIf

That is assuming the text parameter has the "&" character which I cannot see in your picture. WinExists can also see hidden windows thus why I added a condition to check if the window is indeed visible first before clicking the button.

:)

Edit:

Added a string into text parameter of ControlClick for improvement.

Edited by MHz
Posted

Thank you I'll try that, in the Visable txt it has &Close program and there where no hidden txt.

I edited the last post a little. See bottom of last post for reason of edit.

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
×
×
  • Create New...