• 窗体穿透效果


            private const uint WS_EX_LAYERED = 0x80000;
            private const int WS_EX_TRANSPARENT = 0x20;
            private const int GWL_EXSTYLE = (-20);
            private string Var_genre = "";//记录当前操作的类型
    
            #region 在窗口结构中为指定的窗口设置信息
            /// <summary>
            /// 在窗口结构中为指定的窗口设置信息
            /// </summary>
            /// <param name="hwnd">欲为其取得信息的窗口的句柄</param>
            /// <param name="nIndex">欲取回的信息</param>
            /// <param name="dwNewLong">由nIndex指定的窗口信息的新值</param>
            /// <returns></returns>
            [DllImport("user32", EntryPoint = "SetWindowLong")]
            private static extern uint SetWindowLong(IntPtr hwnd, int nIndex, uint dwNewLong);
            #endregion
    
            #region 从指定窗口的结构中取得信息
            /// <summary>
            /// 从指定窗口的结构中取得信息
            /// </summary>
            /// <param name="hwnd">欲为其获取信息的窗口的句柄</param>
            /// <param name="nIndex">欲取回的信息</param>
            /// <returns></returns>
            [DllImport("user32", EntryPoint = "GetWindowLong")]
            private static extern uint GetWindowLong(IntPtr hwnd, int nIndex);
            #endregion
    
            #region 使窗口有鼠标穿透功能
            /// <summary>
            /// 使窗口有鼠标穿透功能
            /// </summary>
            private void CanPenetrate()
            {
                uint intExTemp = GetWindowLong(this.Handle, GWL_EXSTYLE);
                uint oldGWLEx = SetWindowLong(this.Handle, GWL_EXSTYLE, WS_EX_TRANSPARENT | WS_EX_LAYERED);
            }
            #endregion
  • 相关阅读:
    docker swarm 集群搭建和臫servoce对服务扩容
    docker 可视化 portainer
    docker Compose
    hadoop2 安装
    y的最大值最小值切割
    滑块图片拼接
    ast 对象还原
    babel/types is判断
    t.isLiteral()
    杂题集合
  • 原文地址:https://www.cnblogs.com/qq1223558/p/3543225.html
Copyright © 2020-2023  润新知