Happy Fourth of July!

Woke up early so I’ve been working on fixing the problem in IE Script Debugging Toggler where it doesn’t always change the script debugging state in open Internet Explorer Windows. Have been trying to use InternetSetOption() from WinInet.dll to force open windows to update their settings. I’m using the following code:

public static class WinInet
{
 
#region Public Constants
 
public const int INTERNET_OPTION_REFRESH = 37;
 
public const int INTERNET_OPTION_SETTINGS_CHANGED = 39;
 
#endregion

  [DllImport("wininet.dll", SetLastError = true, CharSet = CharSet.Auto)]
 
public static extern bool InternetSetOption(IntPtr hInternet, int dwOption, IntPtr lpBuffer, int dwBufferLength);
}

WinInet.InternetSetOption(IntPtr.Zero, WinInet.INTERNET_OPTION_SETTINGS_CHANGED, IntPtr.Zero, 0);
WinInet.InternetSetOption(IntPtr.Zero, WinInet.INTERNET_OPTION_REFRESH, IntPtr.Zero, 0);

But it doesn’t seem to be working. Reading up on INTERNET_OPTION_SETTINGS_CHANGED and INTERNET_OPTION_REFRESH at MSDN it looks like INTERNET_OPTION_REFRESH only refreshes the proxy data so I problably don’t need to be calling it. As far as INTERNET_OPTION_SETTINGS_CHANGED is concerned they mention “on the next call to InternetConnect” so I’m not clear when that would occur in an open browser. My other thought is that since I can’t find a was to set the script debugging settings using InternetSetOption then maybe an INTERNET_OPTION_SETTINGS_CHANGED won’t refresh those values.

Leave a Reply

You must be logged in to post a comment.