public static void SafeDestroyWindow(ref IntPtr hwnd)
        {
            IntPtr p = hwnd;

            hwnd = IntPtr.Zero;
            if (NativeMethodsShell.IsWindow(p))
            {
                NativeMethodsShell.DestroyWindow(p);
            }
        }