示例#1
0
        internal static bool isFullscreen()
        {
            Winapi.RECT appBounds;
            Rectangle   screenBounds;
            IntPtr      hWnd;

            //get the dimensions of the active window
            hWnd = Winapi.GetForegroundWindow();
            IntPtr desktopHandle = Winapi.GetDesktopWindow();
            IntPtr shellHandle   = Winapi.GetShellWindow();

            if (hWnd != null && !hWnd.Equals(IntPtr.Zero))
            {
                //Check we haven't picked up the desktop or the shell
                if (!(hWnd.Equals(desktopHandle) || hWnd.Equals(shellHandle)))
                {
                    Winapi.GetWindowRect(hWnd, out appBounds);
                    //determine if window is fullscreen
                    screenBounds = Screen.FromHandle(hWnd).Bounds;
                    if ((appBounds.Bottom - appBounds.Top) == screenBounds.Height && (appBounds.Right - appBounds.Left) == screenBounds.Width)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
示例#2
0
        internal static void setWindowNoActivate(IntPtr hwnd, bool isNoActivate = true)
        {
            int oldStyle = Winapi.GetWindowLong(hwnd, Winapi.GWL_EXSTYLE);

            if (isNoActivate)
            {
                Winapi.SetWindowLong(hwnd, Winapi.GWL_EXSTYLE, oldStyle | Winapi.WS_EX_NOACTIVATE);
            }
            else
            {
                Winapi.SetWindowLong(hwnd, Winapi.GWL_EXSTYLE, oldStyle & ~Winapi.WS_EX_NOACTIVATE);
            }
        }
示例#3
0
 internal static bool isJapaneseLocale()
 {
     return(Winapi.GetSystemDefaultLCID() == 1041);
 }