Alistair Saldanha wrote:
I am the person who made the original post. I didn't want to make my message
too long but it may have been too brief. I'm using Visual Basic to control a
WebBrowser control on a Visual Basic form through automation. For instance,
As I understand it, within your VB code you want to be able to react to
an alert message being popped up, presumably by sending a keystroke to
it to dismiss it (or maybe even choose between options or enter input).
I suspect it would be too difficult to guess that the alert is coming
up and then spew a key to dismiss it.
This question is quite interesting, however, and I think it is better
addressed in the newsgroup: microsoft.public.vb.winapi
In particular, I think the call you are looking for is the windows API
SetWindowsHookEx with either WH_CBT (more probably) or WH_SHELL,
probably requiring a DLL. The class of the alert/confirm/prompt
(common dialog) windows are all "#32770" and alert has a single OK
button is a subwindow (class "Button"), while the other two each have
an OK and Cancel button, but the prompt window also has an Edit class
subwindow.
You might do a google search on: "32770" SetWindowsHookEx
Here's a useful page with some ideas:
http://groups-beta.google.com/group/...9d4612fdaec9f/
I'll look forward to seeing more on this topic,
Csaba Gabor from Vienna