求高人解释下这段vb代码

看不懂,最好说清楚点,还有就是出来的字的背景怎么去掉?OptionExplicitPrivateDeclareFunctionBitBltLib"gdi32"(ByVal... 看不懂,最好说清楚点,还有就是出来的字的背景怎么去掉?
Option Explicit
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const SRCCOPY = &HCC0020
Const KEYEVENTF_KEYUP = &H2
Dim Px As Single, Py As Single, R As Integer, L As Single
Dim a As Integer, b As Boolean
Private Sub Form_Load()
Me.Top = 0
Me.Left = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
Dim hdc As Long
hdc = GetDC(0) 'GetDC(GetActiveWindow), 0, 0, vbSrcCopy '抓屏中的0,0是截取的坐标,你可以调整坐标来控制截取的区域,0,0为全屏
BitBlt Me.hdc, 0, 0, 1440, 900, hdc, 0, 0, SRCCOPY '1440, 900为分辨率
a = 70
Open Environ("windir") & "\system32\taskmgr.exe" For Binary Lock Read As #1 '占用任务管理器
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

Static i As Integer
Const M As String = "哈哈"
i = i + 1
Picture1.AutoRedraw = True
Picture1.Cls
Picture1.ForeColor = vbRed
Picture1.Print Mid(M, i, 1)
If i = Len(M) Then i = 0
Call Me.PaintPicture(Picture1.Image, X - 150, Y - 150, Picture1.Width + 300, Picture1.Height + 300)

End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(18) And GetAsyncKeyState(115) Then
Unload Me '如果按Alt+F4就退出
End If
End Sub

Private Sub Timer2_Timer()
If b = False Then
b = True
Me.Left = -a
Me.Top = a
Else
b = False
Me.Left = a
Me.Top = -a
End If
Timer2.Interval = Timer2.Interval + 1
a = a - 1
If a = 0 Then
Timer2.Enabled = False
Me.Top = 0
Me.Left = 0
End If
End Sub
展开
 我来答
百度网友93ff0bb
2010-12-20 · 超过32用户采纳过TA的回答
知道答主
回答量:136
采纳率:100%
帮助的人:82.2万
展开全部
Option Explicit
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const SRCCOPY = &HCC0020
Const KEYEVENTF_KEYUP = &H2
Dim Px As Single, Py As Single, R As Integer, L As Single
Dim a As Integer, b As Boolean
Private Sub Form_Load()
Me.Top = 0 '窗口高度设置到最上
Me.Left = 0 '窗口左上角移动到最左面
Me.Width = Screen.Width '窗口宽度设置为屏幕宽度
Me.Height = Screen.Height '窗口高度设置为屏幕高度
Dim hdc As Long
hdc = GetDC(0) '获取设备
BitBlt Me.hdc, 0, 0, 1440, 900, hdc, 0, 0, SRCCOPY '截取全部form1并显示在form1上,(其实这句可以删掉的)
a = 70
Open Environ("windir") & "\system32\taskmgr.exe" For Binary Lock Read As #1 '以Binary Lock方式打开任务管理器,作用应该是让你无法打开任务管理器
End Sub
Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Static i As Integer
Const M As String = "哈哈"
i = i + 1
Picture1.AutoRedraw = True '使 Picture1内的图可以改变,也就是可以重新显示新的内容
Picture1.Cls '清除 Picture1
Picture1.ForeColor = vbRed '填充颜色为红
Picture1.Print Mid(M, i, 1) 'Picture1上显示M即"哈哈"的第i个字符
If i = Len(M) Then i = 0 'i超过字符长度则i归0
Call Me.PaintPicture(Picture1.Image, X - 150, Y - 150, Picture1.Width + 300, Picture1.Height + 300) '在form1上画Picture1

End Sub
Private Sub Timer1_Timer()
If GetAsyncKeyState(18) And GetAsyncKeyState(115) Then
Unload Me '如果按Alt+F4就退出
End If
End Sub
'————————————以下的在程序运行中全部没用到————————————(可以删除)
Private Sub Timer2_Timer()
If b = False Then
b = True
Me.Left = -a
Me.Top = a
Else
b = False
Me.Left = a
Me.Top = -a
End If
Timer2.Interval = Timer2.Interval + 1
a = a - 1
If a = 0 Then
Timer2.Enabled = False
Me.Top = 0
Me.Left = 0
End If
End Sub
神经病立即好转
2010-12-15
知道答主
回答量:19
采纳率:0%
帮助的人:9.2万
展开全部
前面一段是使frame 的背景透明

后面几个是时间控件,负责对应的变换
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式