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. delete

delete

Scheduled Pinned Locked Moved C#
10 Posts 6 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.
  • N Offline
    N Offline
    nhqlbaislwfiikqraqnm
    wrote on last edited by
    #1

    delete

    R L L M 4 Replies Last reply
    0
    • N nhqlbaislwfiikqraqnm

      delete

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      I don't understand your question.  Do you want your program to navigate the browser to a specific url? /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      N 1 Reply Last reply
      0
      • N nhqlbaislwfiikqraqnm

        delete

        L Offline
        L Offline
        Lost User
        wrote on last edited by
        #3

        textbox1.Text = webBrowser1.Url;

        I know nothing , I know nothing ...

        N 1 Reply Last reply
        0
        • R Ravi Bhavnani

          I don't understand your question.  Do you want your program to navigate the browser to a specific url? /ravi

          My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

          N Offline
          N Offline
          nhqlbaislwfiikqraqnm
          wrote on last edited by
          #4

          No, i want to see in a textbox from my program which url is opened in Firefox or IE. I don´t want to open a Website this works with webbrowser1.Navigate("Url"); Example: I open firefox and i go to codeproject.com . Now i want to see this Url(codeprojekt.com) in my program http://cboard.cprogramming.com/cplusplus-programming/118525-how-get-url-out-firefox.html but that is in C++

          R 1 Reply Last reply
          0
          • L Lost User

            textbox1.Text = webBrowser1.Url;

            I know nothing , I know nothing ...

            N Offline
            N Offline
            nhqlbaislwfiikqraqnm
            wrote on last edited by
            #5

            Yes, that works with the webBrowser from C# but how does it work with Firefox or IE?

            1 Reply Last reply
            0
            • N nhqlbaislwfiikqraqnm

              delete

              L Offline
              L Offline
              Luc Pattyn
              wrote on last edited by
              #6

              Hi, you could read the content of the address bar of some browsers. In C# that would take some P/Invoke code to call FindWindow and GetWindowText; as the window belongs to another process, you would also need to allocate and access memory in that other process. You can find some of the basic techniques in my TrayIconBuster article (LP_Process class). Doing it this way would have several limitations: 1. the solution is slightly different for each specific web browser, as the logical location of the address bar will vary. 2. the address bar does not always represent the current page; e.g. when frames are involved, the bar will show the URL of the frames page, not the contained page(s). The alternative is to create your own browser and have the required functionality built-in. A good starting point would be the WebBrowser Control. Of course, people could still use another browser, but so they can in the former approach (you can't prevent them from downloading and installing FireFox, Safari, Chrome, etc). :)

              Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

              Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

              1 Reply Last reply
              0
              • N nhqlbaislwfiikqraqnm

                delete

                M Offline
                M Offline
                Mycroft Holmes
                wrote on last edited by
                #7

                Isn't this sort of info somewhere in the browser log, history or something, maybe you can use that instead of scraping the browser window.

                Never underestimate the power of human stupidity RAH

                N 1 Reply Last reply
                0
                • N nhqlbaislwfiikqraqnm

                  No, i want to see in a textbox from my program which url is opened in Firefox or IE. I don´t want to open a Website this works with webbrowser1.Navigate("Url"); Example: I open firefox and i go to codeproject.com . Now i want to see this Url(codeprojekt.com) in my program http://cboard.cprogramming.com/cplusplus-programming/118525-how-get-url-out-firefox.html but that is in C++

                  R Offline
                  R Offline
                  Ravi Bhavnani
                  wrote on last edited by
                  #8

                  You could browse IE's url history or write a browser helper object that could send the url to your Windows Forms app. See these articles for ideas:

                  • WebCacheTool: Manipulate the IE Browser Cache From the Command-Line[^]
                  • How to attach to Browser Helper Object (BHO) with C# in two minutes[^]

                  /ravi

                  My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

                  1 Reply Last reply
                  0
                  • M Mycroft Holmes

                    Isn't this sort of info somewhere in the browser log, history or something, maybe you can use that instead of scraping the browser window.

                    Never underestimate the power of human stupidity RAH

                    N Offline
                    N Offline
                    nhqlbaislwfiikqraqnm
                    wrote on last edited by
                    #9

                    Thanks for help this with P/Invoke is a good idea. Now i found this using NDde.Client; class Test { public static string GetFirefoxURL() { DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo"); dde.Connect(); string url = dde.Request("URL", int.MaxValue); dde.Disconnect(); return url; } } i must online add the dll NDde then it works great. http://ndde.codeplex.com/ But it only works with Firefox has sombody an idea how it can work with IE or Opera?

                    S 1 Reply Last reply
                    0
                    • N nhqlbaislwfiikqraqnm

                      Thanks for help this with P/Invoke is a good idea. Now i found this using NDde.Client; class Test { public static string GetFirefoxURL() { DdeClient dde = new DdeClient("Firefox", "WWW_GetWindowInfo"); dde.Connect(); string url = dde.Request("URL", int.MaxValue); dde.Disconnect(); return url; } } i must online add the dll NDde then it works great. http://ndde.codeplex.com/ But it only works with Firefox has sombody an idea how it can work with IE or Opera?

                      S Offline
                      S Offline
                      Saint_pl
                      wrote on last edited by
                      #10

                      I've the same problem. I was searching a long time and the best solution I was found is DllImport(user32.dll) You should use some methods like FindWindow, FindWindowEx and SendMessage. You must first find main class of IE window, e.g. use WinSpy++. Then you go from class to class, from parent to child (IEFrame -> WorkerW -> ReBarWindow32 -> Address Band Root -> edit) First use FindWindow, next FindWindowEx. In class named "edit" there is a url. Use SendMessage, WM_GETTEXT and e.g. StringBuilder class to get the url. But it only works with IE :) How do this in Opera or Chrome? Any idea?

                      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