LitDev.LDTextWindow.Show C# (CSharp) Method

Show() public static method

Show the TextWindow and give it focus. Replacement for standard method that may fail (do not mix these methods).
public static Show ( ) : void
return void
        public static void Show()
        {
            Type TextWindowType = typeof(TextWindow);
            bool _windowVisible = (bool)TextWindowType.GetField("_windowVisible", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).GetValue(null);
            if (!_windowVisible)
            {
                IntPtr hWnd = User32.FindWindow(null, TextWindow.Title);
                User32.ShowWindow(hWnd, User32.ShowWindowCommands.Normal);
                User32.SetForegroundWindow(hWnd);
                TextWindowType.GetField("_windowVisible", BindingFlags.NonPublic | BindingFlags.Static | BindingFlags.IgnoreCase).SetValue(null, true);
            }
        }