none
How to change Pop-up blocker settings using c# RRS feed

  • Question

  • Hello,

    I want to add a website to "Allow web sites" list in pop-up blocker settings using C# and I can't figure out how to.I'm using Visual Studio 2008. Is it something that can be done? I found the key in the registry - it's "HKEY_USERS\S-1-5-21-865322659-4255640127-3857865232-19622\Software\Microsoft\Internet Explorer\New Windows\Allow" but "S-1-5-21-865322659-4255640127-3857865232-19622" is different for different machine. Is there another way to add websites to the list?

    Thanks

    • Moved by Larcolais Gong Monday, November 1, 2010 9:30 AM (From:Visual C# General)
    Friday, October 29, 2010 3:31 PM

Answers

  • Hi Sirish.Shrestha,

    Welcome to MSDN Forums!

     

    I look for the website string in registry after I added a website to the “Pop-up Blocker Settings” manually.

     

    I found the following key, and I tested that key value. So you can use this registry key to store you websites.

     

    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow]

    "*.abc.com"=hex:00,00

     

    This key will be not changed in the different system.

     

    Note: I add the website is: “http://abc.com”

     

    Regards,

    Mike

    -------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.

     

    *****************************************************

    [All-In-One Code Framework]

    Sample world! You will get more from this world!

    Welcome to the new world!

    • Marked as answer by S.S1 Monday, November 8, 2010 8:54 PM
    Monday, November 1, 2010 10:54 AM
    Moderator
  • Hi Sirish.Shrestha,

    You’re welcome.

     

    If you have not receive the alert from MSDN Forums, I think you need to make sure your configuration of your “my alert” settings (you can see this option on the right side of this thread).

     

    Best wishes,

    Mike

    *****************************************************

    [All-In-One Code Framework]

    Sample world! You will get more from this world!

    Welcome to the new world!

    • Marked as answer by S.S1 Wednesday, November 10, 2010 7:24 PM
    • Unmarked as answer by S.S1 Tuesday, April 26, 2011 3:43 PM
    • Marked as answer by S.S1 Tuesday, April 26, 2011 3:43 PM
    Tuesday, November 9, 2010 4:16 AM
    Moderator

All replies

  • Hi Sirish,

    Your concern is more like IE. I will help you moving your thread into appropriate forum. You will get more helpful suggestions there.

    CHEERS,

    Larcolais


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, November 1, 2010 9:30 AM
  • Hi Sirish.Shrestha,

    Welcome to MSDN Forums!

     

    I look for the website string in registry after I added a website to the “Pop-up Blocker Settings” manually.

     

    I found the following key, and I tested that key value. So you can use this registry key to store you websites.

     

    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow]

    "*.abc.com"=hex:00,00

     

    This key will be not changed in the different system.

     

    Note: I add the website is: “http://abc.com”

     

    Regards,

    Mike

    -------------------------------------------------------------------

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to the others community members reading the thread.

     

    *****************************************************

    [All-In-One Code Framework]

    Sample world! You will get more from this world!

    Welcome to the new world!

    • Marked as answer by S.S1 Monday, November 8, 2010 8:54 PM
    Monday, November 1, 2010 10:54 AM
    Moderator
  • Sirish.Shrestha wrote:

    I want to add a website to "Allow web sites" list in pop-up blocker  settings using C# and I can't figure out how to.I'm using
    Visual Studio 2008. Is it something that can be done? I found the key  in the registry - it's
     "HKEY_USERS\S-1-5-21-865322659-4255640127-3857865232-19622\Software\Micro soft\Internet Explorer\New Windows\Allow" but
    "S-1-5-21-865322659-4255640127-3857865232-19622" is different for  different machine.

    I'm pretty sure you'll find the same setting under  HKEY_CURRENT_USER\Software\...
    S-1-5-21-865322659-4255640127-3857865232-19622 is the ID of a particular  user: when a user is logged in, HKEY_CURRENT_USER becomes an alias for  HKEY_USERS\<User's SID>


    Igor Tandetnik

    Monday, November 1, 2010 11:34 AM
  • Yes, what Igor said.

    Please familiarize yourself with the registry before banging on it.

    Monday, November 1, 2010 5:40 PM
  • Mike,

    First of all, sorry for my delayed response. For whatever reason, I can't see this thread in my thread list and I didn't get any alerts in my inbox either although the alert was enabled. I had to remember the title I had put in and then find it - weird. Anyways, thank you all for your response and thanks Mike for the solution. The solution you provided is what I was looking for - it works. Thanks again.

     

    Monday, November 8, 2010 8:53 PM
  • Hi Sirish.Shrestha,

    You’re welcome.

     

    If you have not receive the alert from MSDN Forums, I think you need to make sure your configuration of your “my alert” settings (you can see this option on the right side of this thread).

     

    Best wishes,

    Mike

    *****************************************************

    [All-In-One Code Framework]

    Sample world! You will get more from this world!

    Welcome to the new world!

    • Marked as answer by S.S1 Wednesday, November 10, 2010 7:24 PM
    • Unmarked as answer by S.S1 Tuesday, April 26, 2011 3:43 PM
    • Marked as answer by S.S1 Tuesday, April 26, 2011 3:43 PM
    Tuesday, November 9, 2010 4:16 AM
    Moderator
  • Hi Mike,

     

    Thanks for the post. The solution you provided is really helpful.

    I am able to write website url into registry location  [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow].

    Those list are visible in IE Popup blocker settings also, but still it is showing popup blocker message on some machines.

    Please suggest me to come out of this.

     

    Thanks,

    Sandeep.

    Thursday, June 23, 2011 9:12 AM
  • Hi Mike,

     

    The problem is resolved for me.

    the issue is i am trying to add website url into registry as following format

    http://www.abc.com/

    The solution for my issue is

    www.abc.com

    after removing the protocol(http://) and end slash(/) the popup blocker is not raised.

    I don't know why this format only. If you know please tell me.

    Thanks,

    Sandeep.


    • Proposed as answer by Mani Sandeep Thursday, June 23, 2011 10:28 AM
    Thursday, June 23, 2011 10:27 AM
  • Thanks for the post. The solution you provided is really helpful. :)

    I am able to write website url into registry location

     [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow].

    Those list are visible in IE Popup blocker settings also, 

    But instead of hex number I have write "00" in registry and mine problem get solved.

    The code snippet is as follows.

    ///Method Calling
    WriteRegistryForPopupBlocker("localhost", "00");

    ///Actual Method 

    public void WriteRegistryForPopupBlocker(string keyName, string keyValue)
            {

                    RegistryKey regKey = Registry.CurrentUser;
                    regKey = regKey.CreateSubKey(@"SOFTWARE\Microsoft\Internet Explorer\New Windows\Allow");
                    regKey.SetValue(keyName, keyValue);
                    regKey.Close();
            }

    Once again thanks alot.

     

    Thanks,

    Sudarshan.



    Thursday, April 24, 2014 10:33 AM