How to get current URL from Internet Explorer ?

Hi,
I have design an add-on for IE and I'm
trying to get URL from IE which is currently opened that is which is currently user sees. Is there any way to get it? I want to store that address in label and use it for something useful. Is it possible with C# ?
I have did the following code to get current URL but it showing last opened URL instead of current URL which is user see
using SHDocVw;
       SHDocVw.ShellWindows shellWindows = new SHDocVw.ShellWindows();
                     string filename;
                     foreach (SHDocVw.InternetExplorer ie in shellWindows)
                         filename = Path.GetFileNameWithoutExtension(ie.FullName).ToLower();
                         if (filename.Equals("iexplore"))
                           label1.Text=ie.LocationURL;
                           label1.Text = ie.LocationName;
and I have tried this one also 
foreach (InternetExplorer ie innew ShellWindows())
   label1.Text = ie.LocationURL.ToString();
   label2.Text = ie.LocationName.ToString();
Please give me any suggestion or code to solve this problem.
Thanks.
Priyanka

You already got addon running in the active ie instance. You just need to catch the WindowStateChanged event in every instance so you can write down the last event with OLECMDIDF_WINDOWSTATE_USERVISIBLE somewhere. When you need the active IE instance, just
pull from your save.
Note an IE tab may crash and take your addon with it. It is better to start a broker process to store your global data.
Visual C++ MVP

Similar Messages

  • My Muse test site gets error message from Internet Explorer v8.0.6

    My Muse test site gets error message from Internet Explorer v8.0.6

    What's the URL of the page? Where is the site hosted (Adobe Business Catalyst or elsewhere)? How were the files uploaded to the server (Publish, FTP Upload from within Muse, external FTP client)?

  • How do I get my Favorites from Internet Explorer put on Firefox when I don't even know what file my original Favorites came in when I used Internet Explorer?

    I understand that if I go to "File" and then to "Import" I should be able to somehow get all my previous files that where with the Internet Explorer browser relocated to the Mazilla browser...but I don't know how to do that. Give me detailed help please.

    It did merge them after a fashion, glad I took a backup first even if I did only perhaps create 3 or 4 bookmarks today. So if I have bookmark separators, it's going to figure out which group to put them in (no way). Anyway I thought they would just go down to the bottom of the bookmarks menu like the other method, like when I export and import bookmarks in Firefox where they do go to the end of the Bookmarks Menu folder and would simply delete one folder.
    Anyway this would not be typical because I don't want any bookmarks from IE.

  • How do I get my favorites from Internet Explorer into Fox Fire?

    When I downloaded Fox Fire it asked me what I wanted to import but I was not able to import Internet Explorer Favorites into the Bookmarks....can this be done?

    You can find the Import menu entry in the Bookmarks Manager (Library)
    *Bookmarks > Show All Bookmarks > Import & Backup > Import Data from Another Browser
    *http://kb.mozillazine.org/Import_bookmarks
    If you have problems with importing the IE Favorites in Firefox then export the Favorites in IE to an HTML file and import that file in the Firefox Bookmarks Manager.<br />
    That way you also preserve any sorting that you may have done in IE with the Favorites.
    * Export the favorites in IE to an HTML file (bookmarks.html): File > Import and Export
    * Import the HTML file in Firefox: Bookmarks > Show All Bookmarks > Import & Backup > Import HTML: From File
    See also:
    * http://kb.mozillazine.org/Import_bookmarks ("Import from another browser" and "Import from file")

  • How to Get Current Date from MS Access in a Select Statement

    From a java method, I want to use JDBC to get the current date from MS Access. In Oracle I would do "select sysdate from dual", but I can't figure out how to do it in MS Access. Here are some of my attempts. I have a table in my Access db called PARM.
    //        String sql = "SELECT '0', NOW() FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT DATE() AS CURR_DT FROM PARM";
    //rs.next() is false
    //        String sql = "SELECT NOW()"; 
    //StringIndexOutOfBoundsException: String index out of range: -1
    //        String sql = "select { fn now() } from parm";
            String sql = "SELECT Date()";
    //java.lang.StringIndexOutOfBoundsException: String index out of range: -1
            ResultSet rs = stmt.executeQuery(sql);
            if (rs.next()) {
                return rs.getString(1);
            } else {
                   return null;
              }

    Why are you getting it as a String? You should be getting it as a timestamp.
    Although getString works for me too. There is something else wrong that you haven't shown.
    Here is some shoddy, but simple, test code that demonstrates it working.
    import java.sql.*;
    public class Test{
      public static void main(String args[])throws Exception{
        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection c = DriverManager.getConnection("jdbc:odbc:stats");
        Statement s = c.createStatement();
        ResultSet rs = s.executeQuery("SELECT NOW()");
        while(rs.next()){
          System.out.println(rs.getTimestamp(1));     
        rs.close();
        s.close();
        c.close();
    }

  • Get current URL from PL/SQL Package in Portal

    Hello, anyone knows the magic code to get the URL of current Web page from a package running from inside the same page?
    Thx

    You can use the page_url field of the portlet runtime record.

  • How to get current connection from ejb container

    We have to execute sql statement directly to the database and will use for this issue to connection establish between the ejb container and the database.
    How to get the corresponding object ?

    thanks

  • How come my linkdin profile from Internet Explorer is different in Firefox?

    I have more connection, endorsements, and recommendation when I use Internet Explore then when I go into Linkedin using mozilla. Why is that? Shouldn't they be the same?
    I have a Super Star rating using Internet Explore ...I have a starters rating using Mozilla.

    When I am on a PC with IE11 I'll take a look. But I'll be looking at the edit screen for my own profile, since obviously I do not have permission to edit yours!
    Do you want to post comparison screen shots pointing out the areas of difference? You can cut out personal information that should not appear on a public forum. Either PNG or JPG format is good (when photographs are included, JPG compression is better, otherwise PNG compression is cleaner).
    Also, in case you have different add-ons between the two browsers, do you want to test in Firefox's Safe Mode? That's a standard diagnostic tool to deactivate extensions and some advanced features of Firefox. More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using either:
    * "3-bar" menu button > "?" button > Restart with Add-ons Disabled
    * Help menu > Restart with Add-ons Disabled
    Not all add-ons are disabled: Flash and other plugins still run
    After Firefox shuts down, a small dialog should appear. Click "Start in Safe Mode" (''not'' Reset).
    Any difference, or should I say, any less difference?

  • How to get current month from filename and bulk insert from text file into table?

    I set up some dynamic SQL to help my bulk copy data from a text file to a table.  This works fine for files that come in every day; I get the previous day’s data, based on the file name that’s placed
    in the folder.  That’s why I’m using the ‘-1’.  The dates will look like this: '20140131', so I'm using type 112.
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\system.local\ms\london\FTP\' + convert(varchar, getdate()-1, 112) + '_INDEXPRICES_EOM.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SB_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    I think the syntax will be somewhat similar to this:
    YEAR(date_column)=YEAR(getdate()) AND MONTH(date_column)=MONTH(getdate())
    I’m not totally sure how to incorporate that into my current syntax.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    I tried a couple versions of this.
    Declare @StartDate Date, @EndDate Date
    Select @StartDate = convert(varchar, getdate()-28, 112), @EndDate = convert(varchar, getdate()-1, 112)
    BEGIN
    declare @fullpath1 varchar(1000)
    select @fullpath1 = '''\\ms\london\FTP\' + ''' between ''' + Convert(Varchar(10), @StartDate, 101) + ''' and ''' + Convert(Varchar(10), @EndDate, 101) + '''_SP.SPC'''
    declare @cmd1 nvarchar(1000)
    print (@cmd1)
    select @cmd1 = 'bulk insert [dbo].[SPBMI_Monthly] from ' + @fullpath1 + ' with (FIELDTERMINATOR = ''\t'', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR=''0x0a'')'
    print(@cmd1)
    exec (@cmd1)
    END
    Here’s the string:
    bulk insert [dbo].[SPBMI_Monthly] from '\\ms\london\FTP\' between '02/03/2014' and '03/02/2014'_SP.SPC' with (FIELDTERMINATOR = '\t', FIRSTROW = 5, LASTROW = 675, ROWTERMINATOR='0x0a')
    The error message I keep getting is:
    Msg 156, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'between'.
    Msg 319, Level 15, State 1, Line 1
    Incorrect syntax near the keyword 'with'. If this statement is a common table expression, an xmlnamespaces clause or a change tracking context clause, the previous statement must be terminated with a semicolon.
    I feel like I’m already pushing this thing to the limit. 
    Maybe this last part isn’t possible.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

  • How to get current month from BI 7

    Dear Expert,
    I am working on a BI 7 report and I need to restrict a key figure using the current month and previous month.
    Could you help me to find out how to do so?
    Thank you very much!
    Arthur

    if you want to make  2 diff rest key figures.
    check if you have current month variable under cal.month ,  if not create a variable( single, not range ) for current month
    and make a new selection take key fig and rest with current month. 
    and make a new selection and take the key fig and restrict with  current month variable keep off set as -1
    if you want to make only one restricted key fig  which shows both current and previous then.
    create a variable as range and write a exit code from  sy-datum ( take month and year ) as the high value and substract one and make it as low value.
    Hope this helps

  • How to get Current User from edir C#

    Hi
    1) Using C# Ldap Library, How can I get the current logged in User name
    2) If I have a user name in the following format : User.Ou.Ou.O
    How can I convert that format into a DN and then find the user in
    the tree ?
    Thanks
    KaranMahant
    KaranMahant's Profile: http://forums.novell.com/member.php?userid=64239
    View this thread: http://forums.novell.com/showthread.php?t=386653

    KaranMahant;1857953 Wrote:
    > Hi
    >
    > 1) Using C# Ldap Library, How can I get the current logged in User name
    > ?
    >
    > You can use the 'getbinddn' extension facility to do this (in case you
    > use eDirectory as the server). Check the following sample:
    > http://forgeftp.novell.com/ldapcshar...s/GetBindDN.cs
    >
    > 2) If I have a user name in the following format : User.Ou.Ou.O
    > How can I convert that format into a DN and then find the user in
    > the tree ?
    >
    > There is no helper APIs available in the C# LDAP SDK to convert the
    > dotted format to ',' separated ones. If you are astarter, LDAP expects
    > the data to be in ',' separated format as:
    >
    > cn=user,ou=test,o=org.
    >
    > Thanks
    -WITH REGARDS,-
    *-Palaniappan N-*
    palaniappan1's Profile: http://forums.novell.com/member.php?userid=12325
    View this thread: http://forums.novell.com/showthread.php?t=386653

  • How to get current slide from embedded HTML5 output

    I am using php to run a web application that displays HTML5 captivate files embeded in a HTML web page. What I need to be able to do is when a user clicks a button OUTSIDE of captivate (say maybe a "Finish" button) I need to be able to check if they have completed the interactive captivate capture. My research so far has show that there is little to no documentation on captivates APIs but they do exist. It looks like java script is the best option. How can I embed the captivate HTML5 output and find out if the user completed the Captivate. This could be by slide (i.e. 10/10 slides) or by percentage or a simple "Complete" would work. I just need the value so I can pass it back to php so my app can do its thing.

    You already got addon running in the active ie instance. You just need to catch the WindowStateChanged event in every instance so you can write down the last event with OLECMDIDF_WINDOWSTATE_USERVISIBLE somewhere. When you need the active IE instance, just
    pull from your save.
    Note an IE tab may crash and take your addon with it. It is better to start a broker process to store your global data.
    Visual C++ MVP

  • How to get current row from advanced table

    Hi,
    I have the following code to pick the value of columnA from one of the columns of an advanced table:
    OAViewObject vo = (OAViewObject)am.findViewObject("AAALineVO2");
    if (vo != null)
    OARow vorow = (OARow)vo.getCurrentRow();
    String ColA = (String)vorow.getAttribute("ColumnA");
    String message = ColA; //to throw message so i can verify the value of ColumnA
    throw new OAException(message, OAException.INFORMATION);
    }It's picking up the first value of ColumnA of the first record correctly, however when I add a new row, it's not picking up the value of columnA anymore.
    What am I doing wrong?
    Thanks in advance,
    N

    Try with this:
    import oracle.apps.fnd.lookups.server.LookupCodeVORowImpl;
    public void aaa (String row)
        LookupCodeVORowImpl laborcreateeovorowimpl = (LookupCodeVORowImpl)findRowByRef(row);
    }Thanks
    --Anil                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to make favourites import from Internet Explorer 9 when no posted solution works?

    I have a new windows computer running 64 bit Windows 7. When I click on import favourites from another browser all the right actions appear to happen but there are no favourites there when I open the bookmarks toolbar and tab.I have looked at the suggested solutions for similar problems and not been able to make any of them work.

    Did you try HTML file option ?
    [http://kb.mozillazine.org/Import_bookmarks Import bookmarks]
    [https://support.mozilla.org/en-US/kb/Importing%20Bookmarks%20from%20an%20HTML%20File Importing Bookmarks from an HTML File]
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • Open/get an URL in/from Internet Explorer?

    Just wondering if anyone had any ideas on how to pass a URL (eg."http://www.ibm.com") to Internet Explorer (or Netscape...)
    Or also the otherway round - is it possible to get hold of the current URL in Internet Explorer. Say i was surfing the net and was on ibm.com could i suck this info out of IE from a java prorgam.
    Oly

    Basically, no you can't do this. However, if you've really got to, search the web for JSObject, which provides a link to javascript

Maybe you are looking for