Responding to Web Browser generated MessageBox
-
I have an application I want to modify to navigate to a particular web site under specific conditions in order to trigger an action by the web site. I have to authenticate to the web site, which is easy to do in the URL. However, the browser first pops up with a message box say something to the effect of "You're about to login to the ....". The response options are "yes" and "cancel". Is there a way that I can intercept the message box via the program to have it respond "yes" every time? Additionally is there a way to detect if the message box has even been generated?
I'm not a programmer but I play one at the office
-
I have an application I want to modify to navigate to a particular web site under specific conditions in order to trigger an action by the web site. I have to authenticate to the web site, which is easy to do in the URL. However, the browser first pops up with a message box say something to the effect of "You're about to login to the ....". The response options are "yes" and "cancel". Is there a way that I can intercept the message box via the program to have it respond "yes" every time? Additionally is there a way to detect if the message box has even been generated?
I'm not a programmer but I play one at the office
Well, there are several issues here. When you say "web browser", do you mean the
WebBrowser
control, or an external web browser, like IE, or FireFox? If we're talking aboutWebBrowser
control, then yes, you can probably manage that with a little research and work. If you're talking about an external browser, that's a whole other kettle of fish. The user could be using ANY of the dozen or so available web browsers, each of which still have several versions in significant use. This means you'd have to use Spy++ to discover the window handle of the browser's meassage box window *for each of the supported versions*, and then watch for each of those windows to be created, and respond accordingly. Good luck with that..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001 -
Well, there are several issues here. When you say "web browser", do you mean the
WebBrowser
control, or an external web browser, like IE, or FireFox? If we're talking aboutWebBrowser
control, then yes, you can probably manage that with a little research and work. If you're talking about an external browser, that's a whole other kettle of fish. The user could be using ANY of the dozen or so available web browsers, each of which still have several versions in significant use. This means you'd have to use Spy++ to discover the window handle of the browser's meassage box window *for each of the supported versions*, and then watch for each of those windows to be created, and respond accordingly. Good luck with that..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001Mea culpa. I thought I'd left no space between "Web" and "Browser" in the subject but I guess old typing habits kicked in unnoticed. Yes, it's the WebBrowser control. The functionality I'm looking at would work fine if I were to log into the site when the monitoring program was initiated. But I need to make it such that I can invoke it when the server starts.
I'm not a programmer but I play one at the office
-
Mea culpa. I thought I'd left no space between "Web" and "Browser" in the subject but I guess old typing habits kicked in unnoticed. Yes, it's the WebBrowser control. The functionality I'm looking at would work fine if I were to log into the site when the monitoring program was initiated. But I need to make it such that I can invoke it when the server starts.
I'm not a programmer but I play one at the office
Ahhh... that should make it easier, then. Maybe there's something usable in the response that comes back from the web site when you post the authentication url to the
WebClient
object. It will come back as HTML, so you'll have to parse it, but before you go through the pa5rsing hassle, you should inspect the response in the debugger..45 ACP - because shooting twice is just silly
-----
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997
-----
"The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001