C#做QQ隐藏核心代码!(转CSDN)

代码
 1 private void timer1_Tick(object sender, EventArgs e) 
 2         { 
 3             if (WindowState != FormWindowState.Minimized) 
 4             { 
 5                 int ScreenWidth = Screen.PrimaryScreen.WorkingArea.Width;  //屏幕宽度 
 6                 int ScreenRight = Screen.PrimaryScreen.WorkingArea.Right; //屏幕高度 
 7                 int MouseX = Control.MousePosition.X; //鼠标X位置 
 8                 int MouseY = Control.MousePosition.Y;//鼠标垂直位置 
 9                 if (this.Left < 0 && this.Top < 0
10                 { 
11                     this.Left = 0
12                     this.Top = 1
13                 } 
14                 if (this.Left >= ScreenWidth - this.Right && this.Top < 0//如果自己的左边是否在屏幕的边缘 
15                 { 
16                     this.Left = ScreenWidth; 
17                     this.Top = 0
18                 } 
19                 if (this.Top < 0 && MouseX > this.Left && MouseX < this.Left + this.Width && MouseY < 3
20                 { 
21                     this.Top = 0
22                 } 
23                 if (this.Top <= 0 && this.Left > 0 && this.Left < ScreenWidth - this.Width) 
24                 { 
25                     if (MouseX < this.Left || MouseX > this.Left + this.Width || MouseY > this.Top + this.Right) 
26                     { 
27                         this.Top = 3 - this.Right; 
28                     } 
29                 } 
30                 if (this.Left < 0 && MouseY > this.Top && MouseY < this.Top + this.Width && MouseX < 3
31                 { 
32                     this.Left = 0
33                 } 
34                 if (this.Left <= 0 && this.Top > 0 && this.Top < ScreenRight - this.Right) 
35                 { 
36                     if (MouseY < this.Top || MouseY > this.Top + this.Right || MouseX > this.Width) 
37                     { 
38                         this.Left = 3 - this.Width; 
39                     } 
40                 } 
41 
42 
43                 if (this.Left >= ScreenWidth - this.Width && this.Top > 0 && this.Top < ScreenRight - this.Width) 
44                 { 
45                     if (MouseY < this.Top || MouseY > this.Top + this.Right || MouseX < ScreenWidth - this.Width) 
46                     { 
47                         this.Left = ScreenWidth - 3
48                     } 
49                 } 
50 
51                 if (this.Left > ScreenWidth - 5) //判断自己的左边是否隐藏了 
52                 { 
53                     if (MouseX > ScreenWidth - 5)  //如果隐藏了  判断鼠标是不在屏幕的边缘 
54                     { 
55                         this.Left = ScreenWidth - this.Width; 
56                     } 
57                 } 
58             } 
59 

 

posted @ 2010-01-04 11:10  冯翔  阅读(436)  评论(0)    收藏  举报