zoukankan      html  css  js  c++  java
  • C# 全屏的显示和隐藏

    C#的全屏问题,这里有一个链接http://blog.csdn.net/wuyazhe/article/details/5728286

    该例子,我只是在wince上面测试,在测试的时候,关于findwindow:Hwnd = FindWindow("HHTaskBar", null);这样,在wince上面,工具栏名字是HHTaskBar

        public class FullScreen
        {
            //private static Rectangle m_rectOld= new Rectangle();
            public static bool SetFullScreen()
            {
                int Hwnd = 0;
                Hwnd = FindWindow("HHTaskBar", null);
                if (Hwnd == 0) return false;
                ShowWindow(Hwnd, SW_HIDE);
                Rectangle rectFull = Screen.PrimaryScreen.Bounds;
    
                //SystemParametersInfo(SPI_GETWORKAREA, 0, ref m_rectOld, SPIF_UPDATEINIFILE);
                SystemParametersInfo(SPI_SETWORKAREA, 0, ref rectFull, SPIF_UPDATEINIFILE);
    
                return true;
            }
    
            public static bool SetNormalScreen()
            {
                int Hwnd = 0;
                Hwnd = FindWindow("HHTaskBar", null);
                if (Hwnd == 0) return false;
                ShowWindow(Hwnd, SW_SHOW);
                //SystemParametersInfo(SPI_SETWORKAREA, 0, ref m_rectOld, SPIF_UPDATEINIFILE);
    
                return true;
            }
    
            [DllImport("coredll.dll")]
            public static extern int ShowWindow(int hwnd, int nCmdShow);
            public const int SW_SHOW = 5; public const int SW_HIDE = 0;
            [DllImport("coredll.dll")]
            public static extern int SystemParametersInfo(int uAction, int uParam, ref Rectangle lpvParam, int fuWinIni);
            public const int SPIF_UPDATEINIFILE = 0X1;
            public const int SPI_SETWORKAREA = 47;
            public const int SPI_GETWORKAREA = 48;
            [DllImport("coredll.dll")]
            private static extern int FindWindow(string lpClassName, string lpWindowName);
        }
    View Code
  • 相关阅读:
    Python字典
    Python集合
    Hungray匈牙利算法
    异常捕获模块,throw, try, catch, finally
    《加德纳艺术通史》罗杰克-劳利
    《高效休息法》久贺谷亮
    梯度检验 Gradient check,bias correction, Exponentially Weighted Averages
    方差与偏差,bias vs variance
    大数定理,中心极限定理以及一些常见分布
    聚类-均值漂移
  • 原文地址:https://www.cnblogs.com/cxiaoln/p/3547536.html
Copyright © 2011-2022 走看看