OK, I am posting this on the outside chance someone knows the inner workings of Internet Explorer. Otherwise, you will find this post quite esoteric...

I am making very little progress in trying to figure this out by myself -- or even by using my usual sources.


Quick Background:

If you make modifications to the registry and the program that you are modifying is running, the program will not recognize the changes until you close and then reopen it. This causes the program to "re-initialize" itself by scanning through the registry -- and it will therefore note your changes.

Alternatively, you can issue a message to all top level Windows that tells them to 'Check the registry' for new settings. This is the WM_SETTINGCHANGE message. If you set hWnd parameter to HWND_BROADCAST, "the message is sent to all top-level windows in the system, including disabled or invisible unowned windows".

Now, it is not clear, but Microsoft only seems to document that the WM_SETTINGCHANGE message should be used for changes to: SystemParametersInfo, a change in policy settings, or a change in locale settings.


On to my question. When one modifies the Security zone settings in IE, a message is sent for IE to re-read the registry and re-initialize these settings. It does NOT appear to be the simple WM_SETTINGCHANGE message which can be generated like this:
Private Const HWND_BROADCAST As Long = &HFFFF&
Private Const WM_SETTINGCHANGE As Long = &H1A

Private Declare Function PostMessage Lib "user32" _
Alias "PostMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

One could use SendMessageTimeout(), but I think the result would be the same -- and using PostMessage() is slightly easier.

However, this does NOT cut it. IE still needs to be closed and re-opened. Therefore, the message is somehow incorrect -- and it is not the same message that IE is sending.

I have Spy++ and I am trying to analyze it to figure this out, but it certainly has not been easy.

Any takers?? Thanks.