VB 写蓝屏恶作剧小程序

看了TK博客关于鸟巢蓝屏的图片后,用VB弄了个简单的模拟蓝屏恶作剧程序。靠直觉双击蓝屏文字就退出程序了。程序和源码已放在附件,有兴趣的可以加些病毒功能,这就不多弄了。

模块里调用 API:

Option Explicit
Declare Function SetWindowPos& Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long)
Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

代码:

Private Sub Form_Load()
' 自动按屏幕大小改变窗体显示
Top = 0
Left = 0
Me.Width = Screen.Width
Me.Height = Screen.Height
' 将窗口置于最顶部
Call SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3)
Timer1.Interval = 1
End Sub

Private Sub Label1_DblClick()
' 双击蓝幕文字退出程序
End
End Sub

Private Sub Timer1_Timer()
' 屏蔽鼠标指针
RetFunct = ShowCursor(False)
' 屏蔽键盘按键
SetWindowPos Me.hwnd, -1&, 0&, 0&, 0&, 0&, 3&
End Sub