代码之家  ›  专栏  ›  技术社区  ›  Gold

如何在WindowsCE5.0中隐藏时钟和控制面板(按C或任何注册表值)

  •  0
  • Gold  · 技术社区  · 15 年前

    如何在Windows CE 5.0中隐藏时钟和控制面板

    按C代码或任何注册表值?

    提前感谢

    1 回复  |  直到 15 年前
        1
  •  3
  •   Chris Wallis    15 年前

    我猜你说的时钟和控制面板是指任务栏?

    如果是,我们使用以下帮助程序隐藏/显示整个栏。不过,这是一个相当“困难”的方法,因为它会为系统而不仅仅是你的应用程序隐藏它,所以你需要在应用程序关闭时再次显示它:

        private const int SW_HIDE = 0x0000;
        private const int SW_SHOW = 0x0005;
    
        [DllImport("coredll.dll", EntryPoint = "FindWindowW", SetLastError = true)]
        private static extern IntPtr FindWindowW(string lpClassName, string lpWindowName);
    
        [DllImport("coredll.dll")]
        private static extern int ShowWindow(IntPtr hwnd, int nTaskShow);
    
        public static void HideStartBar()
        {
            IntPtr handle = FindWindowW("HHTaskBar", string.Empty);
            if (handle != IntPtr.Zero)
                ShowWindow(handle, SW_HIDE);
        }
    
        public static void ShowStartBar()
        {
            IntPtr handle = FindWindowW("HHTaskBar", string.Empty);
            if (handle != IntPtr.Zero)
                ShowWindow(handle, SW_SHOW);
        } 
    
    推荐文章