public static bool IsProgramManagerOrHiddenTrayWindow(IntPtr hWnd) { // Kind of magic... var titlebarInfo = new TITLEBARINFO(); titlebarInfo.cbSize = (uint)Marshal.SizeOf(titlebarInfo); if (!NativeMethods.GetTitleBarInfo(hWnd, ref titlebarInfo)) { throw new Win32Exception(); } return (titlebarInfo.rgstate[0] & (uint)TBBStates.STATE_SYSTEM_INVISIBLE) != 0; }
public static extern bool GetTitleBarInfo(IntPtr hWnd, ref TITLEBARINFO pti);