M
MC
Hi all,
I have write a simple program in c# that change proxy setting for IE7
by edit these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,43,05,00,00,03,00,00,00,0e,
00,00,00,6c,6f,63,61,6c,68,6f,73,74,3a,
38,31,31,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00
But... the changes are not applyed in real-time in IE7, I have to open
an other browser for use the new settings.
I have add to my program a system messagge:
public enum SendMessageTimeoutFlags : uint
{
SMTO_NORMAL = 0x0000,
SMTO_BLOCK = 0x0001,
SMTO_ABORTIFHUNG = 0x0002,
SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
}
[DllImport("user32.dll", SetLastError = true, CharSet =
CharSet.Auto)]
static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg,
UIntPtr wParam, UIntPtr lParam, SendMessageTimeoutFlags fuFlags, uint
uTimeout, out UIntPtr lpdwResult);
IntPtr HWND_BROADCAST = new IntPtr(0xffff);
IntPtr WM_SETTINGCHANGE = new IntPtr(0x001A);
[...]
SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE,
UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000,
out result);
But IE7 ignore the signal....
Do you have any suggestion for make active my changes in real-time?
Ciao!
I have write a simple program in c# that change proxy setting for IE7
by edit these registry keys:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings]
"ProxyEnable"=dword:00000001
"ProxyServer"="localhost:8118"
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet
Settings\Connections]
"DefaultConnectionSettings"=hex:46,00,00,00,43,05,00,00,03,00,00,00,0e,
00,00,00,6c,6f,63,61,6c,68,6f,73,74,3a,
38,31,31,38,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,
00,00,00,00,00
But... the changes are not applyed in real-time in IE7, I have to open
an other browser for use the new settings.
I have add to my program a system messagge:
public enum SendMessageTimeoutFlags : uint
{
SMTO_NORMAL = 0x0000,
SMTO_BLOCK = 0x0001,
SMTO_ABORTIFHUNG = 0x0002,
SMTO_NOTIMEOUTIFNOTHUNG = 0x0008
}
[DllImport("user32.dll", SetLastError = true, CharSet =
CharSet.Auto)]
static extern IntPtr SendMessageTimeout(IntPtr hWnd, uint Msg,
UIntPtr wParam, UIntPtr lParam, SendMessageTimeoutFlags fuFlags, uint
uTimeout, out UIntPtr lpdwResult);
IntPtr HWND_BROADCAST = new IntPtr(0xffff);
IntPtr WM_SETTINGCHANGE = new IntPtr(0x001A);
[...]
SendMessageTimeout(HWND_BROADCAST, (uint)WM_SETTINGCHANGE,
UIntPtr.Zero, UIntPtr.Zero, SendMessageTimeoutFlags.SMTO_NORMAL, 1000,
out result);
But IE7 ignore the signal....
Do you have any suggestion for make active my changes in real-time?
Ciao!