Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A late answer, I know, but as it happens I was recently looking for the answer to this question myself, so this may help other errant Googlers...</p> <p>Turns out that "WM_MSO_BROADCASTCHANGE" has no set value. You obtain a value for it dynamically by calling <code>RegisterMessage</code>. See <a href="http://msdn.microsoft.com/en-us/library/ms644947(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/ms644947(v=vs.85).aspx</a></p> <p>Note that in this particular case MS Office appears to broadcast the message, so only other top-level windows will receive it. </p> <p>In general, you can use a tool like Spy++ (provided with Visual Studio and probably the Windows Platform SDKs too) to see what the value of a message is. In this case, Spy++ will also log that it's a registered message. </p> <p>To listen for it you might write some C# code, for example, that looks like this.</p> <pre><code>using System; using System.Windows.Forms; using System.Runtime.InteropServices; .... class ThemeChangeCatcherpublic : Form { private const string WM_MSO_BROADCAST_NAME = "WM_MSO_BROADCASTCHANGE"; private int WM_MSO_BROADCASTCHANGE = 0; internal static class NativeMethods { [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] internal static extern int RegisterWindowMessage(string lpString); } protected override void OnHandleCreated(EventArgs e) { base.OnHandleCreated(e); WM_MSO_BROADCASTCHANGE = NativeMethods.RegisterWindowMessage(WM_MSO_BROADCAST_NAME); } protected override void WndProc(ref Message m) { if (m.Msg == WM_MSO_BROADCASTCHANGE) MessageBox.Show("gotcha!"); else base.WndProc(ref m); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload