A workaround would be to use the EnumChildWindows API to search for a window handle, and if found, use the ShowWindow API with the SW_HIDE flag to hide the window.
Here is an example of using FindWindow if you know the name of the window:
#region Constants private const int SW_HIDE = 0; private const int SW_SHOWNORMAL = 1; private const int SW_SHOW = 5; #endregion Constants #region APIs [System.Runtime.InteropServices.DllImport("user32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [System.Runtime.InteropServices.DllImport("user32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto)] private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow); [System.Runtime.InteropServices.DllImport("user32.dll", CharSet=System.Runtime.InteropServices.CharSet.Auto)] private static extern bool EnableWindow(IntPtr hwnd, bool enabled); #endregion APIs public static void ShowProgress() { IntPtr h = FindWindow(null, "titleofprogresswindow"); ShowWindow(h, SW_SHOW); EnableWindow(h, true); } public static void HideProgress() { IntPtr h = FindWindow(null, "titleofprogresswindow"); ShowWindow(h, SW_HIDE); EnableWindow(h, false); }
source share