public void SendMessageToAllWindows(uint msg, IntPtr wParam, IntPtr lParam) { foreach (KeyValuePair <string, VSWindowHandle> pair in this._vsHandleCollection) { VSWindowHandle handle = pair.Value; if (handle.ControlHandle != IntPtr.Zero) { Win32ProcessMessageInvoker.SendSimpleMessage(handle.ControlHandle, msg, wParam, lParam); } } }
public void ChangeTheme(VSThemes vsTheme) { // Our pointer to the list items never changes but only gets swapped. // So let's re-point the current theme object to the new list item // and invoke a win32 message to all child windows of Visual Studio. // // This is a very efficient and extremely fast way of communicating // without the need to manage event delegates. VSTheme currentTheme = CurrentTheme; CurrentTheme = this._themeCollection.First(theme => theme.VSThemeType == vsTheme); Win32ProcessMessageInvoker.SendSimpleMessage((UInt32)Win32ProjectHeroMessages.WM_ACEMSG_THEME_CHANGED, IntPtr.Zero, IntPtr.Zero); }