Csaba,
Thank you so much for your post.
I cannot change the code in the WebBrowser, I am helping the end user react
to the WebBrowser using Visual Basic automation. The Visual Basic Automation
automatically enters the account number and other details so the end user
doesn't have to enter them manually. What's killing the VB automation are
the consant messages that pop up saying "Another session is running", which
is actually a bug in the WebBrowser coding, but it stops the VB automation
cold. So I'm hoping to do something to sidestep the alerts.
Alistair
"Csaba Gabor" <Csaba@z6.com> wrote in message
news:1122294020.083290.155270@z14g2000cwz.googlegr oups.com...[color=blue]
> Alistair Saldanha wrote:[color=green]
>> 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,[/color]
>
> 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
>[/color]