贾涛ID:jinjazz
98282次访问,排名886好友108人,关注者348
多年从事大型Mis系统开发,对广电行业与房地产行业信息化有一定经验积累。
jinjazz的文章
原创 123 篇
翻译 0 篇
转载 3 篇
评论 285 篇
贾涛的公告
MS MVP -Visual C# 2008-2009
最近评论
chinahuman:请问如何解决返回值和image这一些类型的输入和返回呢?
kogo2005:推荐一个计算机电子书站点

顺风电子书 - 国内最专业的计算机电子书下载站

http://www.1kip.cn
kogo2005:推荐一个计算机电子书站点

顺风电子书 - 国内最专业的计算机电子书下载站

http://www.1kip.cn
devilsu:

推荐给Web程序员,

学习网络赚钱 [ www.888RMB.com.cn ] 为中国赚钱网站,

提供赚钱教程、赚钱经验、赚钱 秘籍、赚钱项目、赚钱产品, 为想赚钱的人群提供一个赚钱的网络平台






devilsu:

推荐给Web程序员,

学习网络赚钱 [ www.888RMB.com.cn ] 为中国赚钱网站,

提供赚钱教程、赚钱经验、赚钱 秘籍、赚钱项目、赚钱产品, 为想赚钱的人群提供一个赚钱的网络平台






文章分类
收藏
    相册
    Csdn
    Blog
    Scott Guthrie 博客中文版(RSS)
    技术站点
    silverlight.net
    存档
    软件项目交易
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    原创 WinForm特效:桌面上的遮罩层收藏

    新一篇: WinForm特效:拦截窗体上各个部位的点击 | 旧一篇: 我的本次mvp申请资料

    一个窗体特效,帮你了解几个windows api函数.效果:windows桌面上增加一个简单的遮罩层,其中WS_EX_TRANSPARENT 比较重要,它实现了鼠标穿透的功能。
    using System;
    
    using System.Drawing;
    
    using System.Windows.Forms;
    
    using System.Runtime.InteropServices;
    
    namespace WindowsApplication40
    
    {
    
        public partial class Form1 : Form
    
        {
    
            public Form1()
    
            {
    
                InitializeComponent();
    
            }
    
            [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
    
            public static extern long GetWindowLong(IntPtr hwnd, int nIndex);
    
    
    
            [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
    
            public static extern long SetWindowLong(IntPtr hwnd, int nIndex, long dwNewLong);
    
    
    
            [DllImport("user32", EntryPoint = "SetLayeredWindowAttributes")]
    
            private static extern int SetLayeredWindowAttributes(IntPtr Handle, int crKey, byte bAlpha, int dwFlags);
    
    
    
            const int GWL_EXSTYLE = -20;
    
            const int WS_EX_TRANSPARENT = 0x20;
    
            const int WS_EX_LAYERED = 0x80000;
    
            const int LWA_ALPHA = 2;
    
    
    
    
    
            private void Form1_Load(object sender, EventArgs e)
    
            {
    
                this.BackColor = Color.Silver;
    
                this.TopMost = true;
    
                this.FormBorderStyle = FormBorderStyle.None;
    
                this.WindowState = FormWindowState.Maximized;
    
                SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) | WS_EX_TRANSPARENT | WS_EX_LAYERED);
    
                SetLayeredWindowAttributes(Handle, 0, 128, LWA_ALPHA );
    
    
    
            }
    
        }
    
    }

    发表于 @ 2008年07月10日 18:38:36|评论(loading...)|收藏

    新一篇: WinForm特效:拦截窗体上各个部位的点击 | 旧一篇: 我的本次mvp申请资料

    评论

    #lxxmlp 发表于2008-07-24 09:37:35  IP: 221.12.171.*
    不加注释的代码,好难看哦~
    #lxxmlp 发表于2008-07-24 09:38:26  IP: 221.12.171.*
    没有注释的代码,好难看哦~
    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © 贾涛