Home > Software engineering >  VBS for Internet explorer alert message box
VBS for Internet explorer alert message box

Time:09-16

Get prompt information such as title, with VBS implementation, "BBB"
Use vba to realize the can also

Page code


Simple

<body>
Aaa
<script language="javascript" type="text/javascript" & gt;
Alert (" BBB ");
</script>


CodePudding user response:

With VBS, basic don't want to...
Unless you get a specialized AcitveX DLL to VBS code to create objects, and calls for the message content of interface,



That is an alert for a different browser (), it is not the same as the "performance",
Some of them are in a "window", there are some direct embedded web page in the "message" (such as Opera as is the case, above the body),
Even with a "window" pop up display, other than the core IE browser, I'm afraid that is not good to identify whether it is "message",

If only (IE now, however, very few people like to use the IE) and the kernel of the IE browser,
Whether can press "window class name to identify the" for the message (possible plus "title content"),
Even so, the need for a global news HOOK, used to SetWindowsHookEx () this API,
All Windows on the HOOK to create news, recognition to the "news" is take its message text line,


CodePudding user response:

reference 1/f, a toast to invite the bright moon response:
with VBS, basic don't want to...
Unless you get a specialized AcitveX DLL to VBS code to create objects, and calls for the message content of interface,



That is an alert for a different browser (), it is not the same as the "performance",
Some of them are in a "window", there are some direct embedded web page in the "message" (such as Opera as is the case, above the body),
Even with a "window" pop up display, other than the core IE browser, I'm afraid that is not good to identify whether it is "message",

If only (IE now, however, very few people like to use the IE) and the kernel of the IE browser,
Whether can press "window class name to identify the" for the message (possible plus "title content"),
Even so, the need for a global news HOOK, used to SetWindowsHookEx () this API,
All Windows on the HOOK to create news, recognition to the "news" is take its message text line,




The HOOK will not use the
Want to sell get window object, it seems that only access to the main window object, is there any way to get alert window object and then obtains the message box,
Set the shell=CreateObject (" shell. Application ")
For I=0 To shell. The Windows. The Count - 1
Set the window=shell. Windows (I)

Title=the Empty
On the Error Resume Next
Title=the window. The document. The title
On Error Goto 0

If the title & lt;> The Empty Then
If InStr (" simple ", the title)=1 Then
'the main window object
Msgbox (Windows)

The Exit For
End the If
End the If
Next
  •  Tags:  
  • VBA
  • Related