Esempio n. 1
0
        private void HideFromTab()
        {
            var wndHelper = new WindowInteropHelper(this);
            var exStyle   = (long)User32Methods.GetWindowLongPtr(wndHelper.Handle, (int)WindowLongFlags.GWL_EXSTYLE);

            exStyle |= (int)WindowExStyles.WS_EX_TOOLWINDOW;
            User32Methods.SetWindowLongPtr(wndHelper.Handle, (int)WindowLongFlags.GWL_EXSTYLE, (IntPtr)exStyle);
        }
Esempio n. 2
0
        /// <summary>
        /// 使目标句柄位于系统最下层
        /// </summary>
        /// <param name="window">WPF window object</param>
        public static void HideAppInTaskbar(Window window)
        {
            window.WindowStyle   = WindowStyle.None;
            window.WindowState   = WindowState.Maximized;
            window.ShowInTaskbar = false;
            var ptr = new WindowInteropHelper(window).Handle;

            var longvalue = User32Methods.GetWindowLongPtr(ptr, -20).ToInt64();

            longvalue = longvalue | 0x00000080;

            User32Methods.SetWindowLongPtr(ptr, -20, new IntPtr(longvalue));
        }
Esempio n. 3
0
 public IntPtr GetParam(WindowLongFlags index)
 {
     return(User32Methods.GetWindowLongPtr(this.Handle, (int)index));
 }