Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Simple Window Closing Madness

$
0
0
I am having some issues with what should be the simplest of scripts.  I have a program that records internet tv.  If the network drops for some reason, an error window pops up and it will not record anything that is scheduled from that point on until the error is closed.  So if this occurs at night when I am sleeping, I could miss recording several tv shows.  So here is what I have done.

The error windows do not have a title so I am using the window text and WinGetHandle to close.

Like this...

while 1
sleep(100)
if WinExists("","ネットワークに接続できません。") then
$handle = WinGetHandle("","ネットワークに接続できません。")
WinClose($handle)
;MsgBox(0, "WinGetHandle Result",$handle)
EndIf
Wend


I have tested this out by manually creating the error window using this and the above script will close the window fine.

MsgBox(0, "","ネットワークに接続できません。")


When I force the program to throw the error by disconnecting my network cable, the error window comes up but never closes.  I added the WinGetHandle Result msgbox to see if it was even detecting the window.  It does display the proper handle, I confirmed it by using the AutoIt Window Info tool.

I even tried this but it doesn't work either.....

while 1
sleep(100)
if WinExists("","ネットワークに接続できません。") then
$handle = WinGetHandle("","ネットワークに接続できません。")
WinActivate($handle)
Send("{ESC}")
;MsgBox(0, "WinGetHandle Result",$handle)
EndIf
Wend


Any suggestions?

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>