点击保存按钮后调用的save函数如下:
Code: Select all
function save(){
if(confirm("确认保存?")){
document.frm.action="….”;
document.frm.submit();
}
resetDisabledButton();
}
Window Title:
来自网页的消息
ahk_class #32770
ahk_exe iexplore.exe
Control Under Mouse Position:
ClassNN: Button1
Text: 确定
Color: 000000 (Red=00 Green=00 Blue=00)
我写的脚本如下
Code: Select all
SetTitleMatchMode Regex
gui +lastfound
hwnd := winexist()
dllcall( "RegisterShellHookWindow", uint,hwnd )
msgnum := dllcall( "RegisterWindowMessage", Str,"SHELLHOOK" )
onmessage( msgnum, "shellmessage" )
return
shellmessage(wparam,lparam) {
if (wparam = 32772) && winexist("来自网页的消息")
ControlClick, Button1, 来自网页的消息, 确认保存?
}
F2::
try{
Pwb := WBGet()
Pwb.document.getElementById("saveButton").click()
' ControlClick, Button1, 来自网页的消息, 确认保存?
}
return