On Wed, 27 Feb 2002 15:31:40 -0800, "sudheer sajja"
<sud...@mytechplace.com> wrote:
>I have a problem understanding the message arguments of
>the sendmessagetimeout function that is used to braodcast
>the WM_SETTINGCHANGE message to all the top level windows
>for shell updates.
>Its says wparam and lparam are specific to the
>WM_SETTINGCHANGE. Some places it shows WM_SETTINGCHANGE is
>similar to WM_WININICHANGE. I have &H1A as the constant
>value for WM_WININICHANGE, so when i use that it doesnt
>broadcast.
>could anybody help me with this issue
-Tom
(please post replies to the newsgroup)
1. The program in question is service-based, like IIS.
This happens because IIS has no windows which could
intercept the broadcast message. I've even tried stopping
& starting IIS, to no avail. I think the system caches
the environment variables for the services to use on
system startup or something like. If someone can show me
how to broadcast to services or apps without windows, that
would be great.
2. You are on Win9x.
Here is an example on how to broadcast:
Private Declare Function SendMessageTimeout Lib "user32" _
Alias "SendMessageTimeoutA" (ByVal hwnd As Long, _
ByVal msg As Long, ByVal wParam As Long, _
ByVal lParam As String, ByVal fuFlags As Long, _
ByVal uTimeout As Long, lpdwResult As Long) As Long
Private Const HWND_BROADCAST As Long = &HFFFF&
Private Const SMTO_ABORTIFHUNG As Long = &H2
Private Const WM_SETTINGCHANGE As Long = &H1A
Private Sub BroadcastEnvironmentChange()
Dim lngReturnValue As Long
SendMessageTimeout HWND_BROADCAST, _
WM_SETTINGCHANGE, 0&, _
"Environment", _
SMTO_ABORTIFHUNG, _
5000&, lngReturnValue
End Sub
>.
>
From the MSDN:
BroadcastSystemMessage
The BroadcastSystemMessage function sends a message to the specified
recipients. The recipients can be applications, installable drivers, network
drivers, system-level device drivers, or any combination of these system
components.
--
Eduardo A. Morcillo (MS MVP)
http://www.domaindlx.com/e_morcillo