Message “winwait未捕获”;“来自网页的信息”;

Message “winwait未捕获”;“来自网页的信息”;,message,webpage,autohotkey,Message,Webpage,Autohotkey,我正在尝试使用自动热键来确认网站的超时消息,并使会话自动保持活动状态。Winwait似乎是实现这一点的理想函数,但出于某种原因,它没有完成我认为它应该做的事情 以下是我编写的不起作用的函数: DetectHiddenWindows, On SetTitleMatchMode 2 winwait, Message from webpage, Your TrackWise session is expiring ControlClick, Button1, Message fro

我正在尝试使用自动热键来确认网站的超时消息,并使会话自动保持活动状态。Winwait似乎是实现这一点的理想函数,但出于某种原因,它没有完成我认为它应该做的事情

以下是我编写的不起作用的函数:

  DetectHiddenWindows, On
  SetTitleMatchMode 2
  winwait, Message from webpage, Your TrackWise session is expiring
    ControlClick, Button1, Message from webpage, Your TrackWise session is expiring
  return
该窗口是internet explorer中的弹出窗口。以下是window spy告诉我的有关要检测的窗口的信息,并自动单击“确定”:

>>>>>>>>>>( Window Title & Class )<<<<<<<<<<<
Message from webpage
ahk_class #32770

>>>>>>>>>>>>( Mouse Position )<<<<<<<<<<<<<
On Screen:  1503, 692  (less often used)
In Active Window:   1219, 259

>>>>>>>>>( Now Under Mouse Cursor )<<<<<<<<

Color:  0xF0F0F0  (Blue=F0 Green=F0 Red=F0)

>>>>>>>>>>( Active Window Position )<<<<<<<<<<
left: 284     top: 433     width: 484     height: 174


>>>>>>>>>>>( Status Bar Text )<<<<<<<<<<

>>>>>>>>>>>( Visible Window Text )<<<<<<<<<<<
OK
Cancel
Your TrackWise session is expiring in 15 minute(s). 
If you would like to continue click OK, otherwise you will be logged off TrackWise.

>>>>>>>>>>>( Hidden Window Text )<<<<<<<<<<<

>>>>( TitleMatchMode=slow Visible Text )<<<<

>>>>( TitleMatchMode=slow Hidden Text )<<<<
然后win+k单击右键,使网页会话保持活动状态,就像我想要的,只是不像我想要的那样自动


有什么建议吗?谢谢你

我无法用IE10复制。我通过模拟弹出窗口和您的代码(只需
WinWait
)进行了测试。它会在创建时立即找到窗口。WinWait是否检测到您机器上的弹出窗口?
titleOption:="ahk_exe iexplore.exe ahk_class #32770", GW_OWNER:=4
Loop
{
   WinWait, % titleOption
   WinGet, procName, ProcessName
         , % "ahk_id "DllCall("GetWindow", "Ptr", hWnd:=WinExist(titleOption)
                                         , "UInt", GW_OWNER
                                         , "Ptr")
   If % procName=="IEXPLORE.EXE"
      ControlClick, % "Button1", % "ahk_id "hWnd
   Sleep, 250
}
titleOption:="ahk_exe iexplore.exe ahk_class #32770", GW_OWNER:=4
Loop
{
   WinWait, % titleOption
   WinGet, procName, ProcessName
         , % "ahk_id "DllCall("GetWindow", "Ptr", hWnd:=WinExist(titleOption)
                                         , "UInt", GW_OWNER
                                         , "Ptr")
   If % procName=="IEXPLORE.EXE"
      ControlClick, % "Button1", % "ahk_id "hWnd
   Sleep, 250
}