Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Responding to Web Browser generated MessageBox

Responding to Web Browser generated MessageBox

Scheduled Pinned Locked Moved C#
databasequestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    Lilith C
    wrote on last edited by
    #1

    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

    R 1 Reply Last reply
    0
    • L Lilith C

      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

      R Offline
      R Offline
      realJSOP
      wrote on last edited by
      #2

      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 about WebBrowser 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

      L 1 Reply Last reply
      0
      • R realJSOP

        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 about WebBrowser 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

        L Offline
        L Offline
        Lilith C
        wrote on last edited by
        #3

        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

        R 1 Reply Last reply
        0
        • L Lilith C

          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

          R Offline
          R Offline
          realJSOP
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups