| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 3760 人关注过本帖
标题:ecjob API应用 仿QQ右下解弹窗信息 例程
只看楼主 加入收藏
ecjob
Rank: 3Rank: 3
等 级:论坛游侠
威 望:8
帖 子:321
专家分:110
注 册:2006-10-15
收藏
 问题点数:0 回复次数:17 
ecjob API应用 仿QQ右下解弹窗信息 例程
嘻嘻。。刚才参考了下别的语言写的。。用到了API

Demo.rar (31.74 KB)
收到的鲜花
  • 小仙2008-10-18 11:23 送鲜花  49朵   附言:我很赞同
搜索更多相关主题的帖子: 例程 API ecjob 应用 
2008-10-15 23:40
myemail1983
Rank: 2
来 自:南京
等 级:新手上路
威 望:3
帖 子:256
专家分:0
注 册:2008-7-27
收藏
得分:0 
job 的帖子,顶下,顺便问句,你擅长哪方面的程序?

寻找学习的动力,承接小型程序设计,呵呵,为了激励自己学习下。
虽然做不到无私,但会学着去帮助别人
2008-10-16 00:00
ecjob
Rank: 3Rank: 3
等 级:论坛游侠
威 望:8
帖 子:321
专家分:110
注 册:2006-10-15
收藏
得分:0 
关注的人真少啊。

楼上是否有好介绍。。。
是高级语言的程序就可以了。呵呵。。  这网络资源多。。

86年出生,广东求 女人/项目/工作 ,见广告即有效.论坛PM
2008-10-16 19:01
小仙
Rank: 7Rank: 7Rank: 7
来 自:光之谷
等 级:贵宾
威 望:39
帖 子:1812
专家分:1
注 册:2008-8-8
收藏
得分:0 
给你顶一下,希望代码多加讲解。


仁者乐膳,智者乐睡。我都爱~
2008-10-18 11:24
guang
Rank: 4
来 自:广东深圳
等 级:贵宾
威 望:13
帖 子:1414
专家分:285
注 册:2006-4-3
收藏
得分:0 
一定要顶

不相信未作牺牲竟先可拥有,只相信靠双手找到我的欲求!!
我的博客:http://liao5930.blog.
2008-10-18 13:54
skyzoneskyzone
Rank: 1
等 级:新手上路
威 望:1
帖 子:137
专家分:0
注 册:2008-10-6
收藏
得分:0 
using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace Demo
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        #region 常量
        private const int Flags常量 = 2;
        #endregion

        #region DLL函数定义
        [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
        public static extern int SetWindowLong(IntPtr hwnd,int nIndex,int dwNewLong);
        [DllImport("user32.dll")]
        static extern bool SetLayeredWindowAttributes(IntPtr hwnd, int crKey,byte bAlpha, int dwFlags);
        [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
        public static extern int GetWindowLong(IntPtr  hwnd,int nIndex);
        [DllImport("user32.dll", EntryPoint = "FindWindow")]
        public static extern int FindWindow(string lpClassName,string lpWindowName);
        #endregion

        #region 全局变量
        private IntPtr m_int窗口句柄 = IntPtr.Zero;
        #endregion

        #region 事件
        private void Form1_Load(object sender, EventArgs e)
        {
            int o_int窗口信息 = 0;
            m_int窗口句柄 = this.Handle;
            o_int窗口信息 = GetWindowLong(m_int窗口句柄, -20);
            o_int窗口信息 = (o_int窗口信息 | 524288);
            SetWindowLong(m_int窗口句柄, -20, o_int窗口信息);
            SetLayeredWindowAttributes(m_int窗口句柄, 0, 100, Flags常量);
            timer2.Interval = 50;
            timer2.Start();
            this.Left = Screen.PrimaryScreen.Bounds.Width - 200;
            this.Top = Screen.PrimaryScreen.Bounds.Height;
            timer1.Interval = 50;
            timer1.Start();

        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            int a = 255;
            IntPtr o_int窗口句柄 = this.Handle;
            int o_int窗口信息 = GetWindowLong(m_int窗口句柄, -20);
            o_int窗口信息 = (o_int窗口信息 | 524288);
            SetWindowLong(m_int窗口句柄, -20, o_int窗口信息);
            SetLayeredWindowAttributes(o_int窗口句柄, 0, (byte)a, Flags常量);
            while (a > 50)
            {
                a = a - 20;
                SetLayeredWindowAttributes(o_int窗口句柄, 0, (byte)a, Flags常量);
                System.Threading.Thread.Sleep(100);
            }
            this.Dispose();
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            int a = 0;
            while (a != 250)
            {
                a = a + 50;
                SetLayeredWindowAttributes(m_int窗口句柄, 0, (byte)a, Flags常量);
                System.Threading.Thread.Sleep(100);

            }

            timer1.Stop();
        }

        private void timer2_Tick(object sender, EventArgs e)
        {
            if (this.Top < Screen.PrimaryScreen.Bounds.Height - 200)
            {
                timer2.Stop();
            }
            this.Top = this.Top - 8;
        }
        #endregion

        private void label1_Click(object sender, EventArgs e)
        {

        }
        
    }
}
==========================
感觉dll在c#里调用很不方便(也可能是功能强大的原因?)
另外,我觉得不用dll也完全可以达到这样的效果吧???
用坐标和透明度属性应该就可以.

读万卷书莫如行万里路,行路在问题答题之中。
2008-10-18 17:19
ecjob
Rank: 3Rank: 3
等 级:论坛游侠
威 望:8
帖 子:321
专家分:110
注 册:2006-10-15
收藏
得分:0 
不用SetLayeredWindowAttributes透明不了窗口边框。。
可能写个region或重写可以,但代码肯定长很多。

winform 程序离开了api 就没意思了。。。

86年出生,广东求 女人/项目/工作 ,见广告即有效.论坛PM
2008-10-18 19:07
skyzoneskyzone
Rank: 1
等 级:新手上路
威 望:1
帖 子:137
专家分:0
注 册:2008-10-6
收藏
得分:0 
嗯,有道理.我就是想偷懒,能省则省,不能省就算了.
楼主,能不能给解释下这几个API的含义和用法.
api在c#下这么多参数怎么办?

读万卷书莫如行万里路,行路在问题答题之中。
2008-10-18 20:38
smltq
Rank: 6Rank: 6
等 级:侠之大者
威 望:8
帖 子:566
专家分:400
注 册:2008-1-21
收藏
得分:0 
[bo][un]ecjob[/un] 在 2008-10-16 19:01 的发言:[/bo]

关注的人真少啊。

 


我们一直在默默地关注着你...

简单的生活
2008-10-19 00:09
ecjob
Rank: 3Rank: 3
等 级:论坛游侠
威 望:8
帖 子:321
专家分:110
注 册:2006-10-15
收藏
得分:0 
[bo][un]smltq[/un] 在 2008-10-19 00:09 的发言:[/bo]



我们一直在默默地关注着你...



谢谢。。 呵呵。。 刚又发了一个例程。希望 你们有空会下来玩玩。。

86年出生,广东求 女人/项目/工作 ,见广告即有效.论坛PM
2008-10-19 00:13
快速回复:ecjob API应用 仿QQ右下解弹窗信息 例程
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017283 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved