zoukankan      html  css  js  c++  java
  • 窗体穿透效果

            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
  • 相关阅读:
    CSS margin重叠 & CSS BFC(Block Formatting Context)
    require.js
    bind()函数的作用
    JavaScript DOM 总结
    插入排序-直接插入排序、希尔排序
    交换排序-起泡排序、快速排序算法
    JavaScript全局函数
    JavaScript命名空间的理解与实现
    document.documentElement.clientWidth
    Python-删除多级目录
  • 原文地址:https://www.cnblogs.com/qq1223558/p/3543225.html
Copyright © 2011-2022 走看看