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
  • 相关阅读:
    测试用例(等价类和边界值方法)
    缺陷报告的组成
    软件测试QA、QC、QM的关系与区别
    软件的开发模式
    软件工程及生命周期
    互联网产品类型与产品工具
    canvas 时钟
    test2
    test121212
    关于iOS和OS X废弃的API你需要知道的一切
  • 原文地址:https://www.cnblogs.com/cxiaoln/p/3547536.html
Copyright © 2011-2022 走看看