Need to suppress/destroy/press "OK" auto-proxy config alert dialog!! - Please?!?

Need to suppress/destroy/press "OK" auto-proxy config alert dialog!! - Please?!?

Post by innovate200 » Mon, 07 Jul 2003 11:36:01



 My app is using wininet to get and post data. I've gotten it to work fine.
 The issue (and deal breaker so far) I'm having is that every few
 InternetOpenURL calls the auto-proxy config throws an alert box that hangs
 the program until the OK button is pressed.
 I thought originally that I could use API's like SetWindowsHookEx and
 SendMessage to find and destroy the window (even tried using SetTimer API
to
 call an exe from a different thread), but after enumerating the windows,
the
 javascript alert does not appear in the Windows list.
 I am at a total loss. I still think the different thread option holds the
 most promise, but I am indeed stuck and if I don't find a solution, I'm
sunk
 (first project for a new client after 2 years of no work).

I looked at Spy++ to see if I could get any more info and I found the Thread
ID that was in a "Wait" state (due to user response required (clicking the
"OK" button on the alert box - which i need to do programmattically - which
brings me back to the reason for this excercize)) - any ideas on how I can
use this to my advantage?

 Any ideas are appreciated.

 Thanks

 ch

 
 
 

Need to suppress/destroy/press "OK" auto-proxy config alert dialog!! - Please?!?

Post by James Brow » Mon, 07 Jul 2003 22:03:01


Personally, I would re-visit the SetWindowsHook option...
in particular, try setting a CBT_HOOK (computer-based-training) which
is called purely for simple events like window creation, activation..
If a messagebox is being displayed, then you *will* see this happening.
The trick is setting the hook on the correct thread - if this messagebox
/dialog is
being shown from your primary thread, then it is simple, if it is some other
system thread then it will be easier to set a system-wide hook.

Check out the tutorials section of my site for the "custom messagebox" page,
which shows how to do this..

James

--
www.catch22.org.uk
Free Win32 Software, Source Code and Tutorials


Quote:> My app is using wininet to get and post data. I've gotten it to work fine.
>  The issue (and deal breaker so far) I'm having is that every few
>  InternetOpenURL calls the auto-proxy config throws an alert box that
hangs
>  the program until the OK button is pressed.
>  I thought originally that I could use API's like SetWindowsHookEx and
>  SendMessage to find and destroy the window (even tried using SetTimer API
> to
>  call an exe from a different thread), but after enumerating the windows,
> the
>  javascript alert does not appear in the Windows list.
>  I am at a total loss. I still think the different thread option holds the
>  most promise, but I am indeed stuck and if I don't find a solution, I'm
> sunk
>  (first project for a new client after 2 years of no work).

> I looked at Spy++ to see if I could get any more info and I found the
Thread
> ID that was in a "Wait" state (due to user response required (clicking the
> "OK" button on the alert box - which i need to do programmattically -
which
> brings me back to the reason for this excercize)) - any ideas on how I can
> use this to my advantage?

>  Any ideas are appreciated.

>  Thanks

>  ch