实在没有上传了。我自己现写的程序都大了点,文件也分的多,不好上传,就把以前一个朋友的代码拿给大家:
Option Explicit
Private Declare Function GetDC Lib "user32" ( _
ByVal hwnd As Long) As Long
Private Declare Function ReleaseDC Lib "user32" ( _
ByVal hwnd As Long, _
ByVal hdc As Long) As Long
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 lngDC As Long
Private blnLOOP As Boolean
Private Sub Form_Click()
blnLOOP = False
End Sub
Private Sub Form_KeyPress(KeyAscii As Integer)
blnLOOP = False
End Sub
Private Sub Form_Load()
Dim intX As Integer, intY As Integer
Dim intI As Integer, intJ As Integer
Dim intWidth As Integer, intHeight As Integer
intWidth = Screen.Width / Screen.TwipsPerPixelX
intHeight = Screen.Height / Screen.TwipsPerPixelY
frmMain.Top = 0
frmMain.Left = 0
frmMain.Width = Screen.Width
frmMain.Height = Screen.Height
lngDC = GetDC(0)
Call BitBlt(Me.hdc, 0, 0, intWidth, intHeight, lngDC, 0, 0, vbSrcCopy)
frmMain.Visible = True
frmMain.AutoRedraw = False
Randomize
blnLOOP = True
Do While blnLOOP
intX = (intWidth - 128) * Rnd
intY = (intHeight - 128) * Rnd
intI = 2 * Rnd - 1
intJ = 2 * Rnd - 1
Call BitBlt(frmMain.hdc, intX + intI, intY + intJ, 128, 128, frmMain.hdc, intX, intY, vbSrcCopy)
DoEvents
Loop
Set frmMain = Nothing
Call ReleaseDC(0, lngDC)
End
End Sub