henrickd

AutoIT window info detects window, but script does not

6 posts in this topic

I want to get rid of a popup, specifically this one: https://i.ytimg.com/vi/ff7ElV5WatA/maxresdefault.jpg

It is detected by AutoIT window info, I get the name and class. However, when I write my script to close it, it simply does not detect the presence of the window. I know this because I've set a variable to change when this window is detected, but it never changes. Whether I refer to the window by its title or class does not matter. However, my script works just fine on other types of windows.

Here's the relevant info:
Title: This app can't open
Class: Shell_SystemDialog

Here's my code:

#include <MsgBoxConstants.au3>
$i = 0
While 1
   If WinExists("This app can't open") Then
      Send("{ENTER}")
      $i = 1
   EndIf
   If WinExists("[CLASS:Shell_SystemDialog]") Then
      Send("{ENTER}")
      $i = 1
   EndIf
   MsgBox($MB_SYSTEMMODAL, "", $i)
   Sleep(1000)
 WEnd


 

Share this post


Link to post
Share on other sites



Are you sure, that window isn't found? Maybe it's a app that needs Adminpriviliges to automate it.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Was there ever a solution to this?

We are running Windows 10 Education Edition version 1607 on a school network with roaming profiles. After the update to 1607, when a user logs on, Windows displays a message box "We can't sign in to your account". This is a know issue with no suggested solution that I can find that involves continuing to use roaming profiles. It is meaningless but a nuisance and worries the pupils who often panic and sign out thus wasting class time. This appears before any startup programs are run from registry "run" keys or startup folder.

wecantsignin.JPG

The Windows Info tool detects the window with the title "We can't sign in to your account". I have written this script to attempt to click "Enter" on the "Dismiss" button (which does not show as a control) as I have tested that when the window is active, Tab then Enter does the Dismiss.

if WinExists ("We can't sign into your account") Then
    MsgBox(0, "Debug", "Window exists")
    WinActivate ("We can't sign into your account")
    Send("{Tab}{ENTER}")
Else
    MsgBox(0, "Debug", "Window does not exist")
    If WinWait("We can't sign into your account","",10) <>0 Then
       MsgBox(0, "Debug", "Window now exists")
       WinActivate ("We can't sign into your account")
       Send("{Tab}{ENTER}")
    Else
       MsgBox(0, "Debug", "Window never existed")
    EndIf
EndIf

; Finished
Exit

When I run the script my debug output messages show the window does not (ever) exist when the script is run. I see "Window does not exist", then after the wait time "Window never existed". Obviously, the window is still there. I have run it in an elevated script editor window, compiled and compiled elevated - same result. Does anyone have any suggestions please?

TIA.

Frustrated OldLag.

Edited by OldLag
Add code tag

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Sorry, I've just learned about code tags, which i have now added in edit.

Edited by OldLag
Able to edit original text.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Some windows seem impossible to interact with, even when detected.

Have you tried giving your program Admin Rights, as suggested in Post #2?

I recently discovered with a problem window, that adding #RequireAdmin to the top of my script, worked wonders.

Edited by TheSaint

AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

#6 ·  Posted

Thanks Saint, but that makes no difference. Microshafted! :angry:

Share this post


Link to post
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