Option Explicit
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal width As Long, ByVal height As Long, ByVal repaint As Boolean) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Private Const VK_LWIN = &H5B
Private Const KEYEVENTF_KEYUP = &H2
Private Const VK_APPS = &H5D
Private Const VK_PLAY = &HFA
Dim wnd As Long, wnd2 As Long, bool As Boolean
Private Sub Command1_Click()
Dim i As Integer, ii As Integer
Const VK_ACTION = &H4D
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(VK_ACTION, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
Sleep 1000
wnd = FindWindow("Shell_TrayWnd", vbNullString)
wnd = FindWindowEx(wnd, 0, "Button", vbNullString)
wnd2 = FindWindow("Progman", vbNullString)
wnd2 = FindWindowEx(wnd2, 0, "ShellDll_DefView", vbNullString)
Do While bool = False
For i = 0 To 200
DoEvents
If bool = True Then
MoveWindow wnd, 0, 0, 50, 22, -1
MoveWindow wnd2, 0, 0, 800, 600, -1
End
Exit For
Exit Do
End If
Sleep 200 - i
MoveWindow wnd, i * 5, 0, 50, 22, -1
MoveWindow wnd2, i * 5, 0, 800, 600, -1
If i = 30 Or i = 60 Or i = 100 Or i = 120 Or i = 150 Then
For ii = i To i / 2 Step -1
Sleep i - ii
MoveWindow wnd, ii * 5, 0, 50, 22, -1
MoveWindow wnd2, ii * 5 / 2, ii * 5 / 2, 800 - ii * 5, 600 - ii * 5, -1
Next ii
End If
Next i
For i = 200 To 0 Step -1
Sleep 200 - i
DoEvents
If bool = True Then
MoveWindow wnd, 0, 0, 50, 22, -1
MoveWindow wnd2, 0, 0, 800, 600, -1
End
Exit For
Exit Do
End If
Sleep 200 - i
MoveWindow wnd, i * 5, 0, 50, 22, -1
MoveWindow wnd2, i * 5, 0, 800, 600, -1
If i = 30 Or i = 60 Or i = 100 Or i = 120 Or i = 150 Then
For ii = i To i / 2 Step -1
Sleep i - ii
MoveWindow wnd, ii * 5, 0, 50, 22, -1
MoveWindow wnd2, ii * 5 / 2, ii * 5 / 2, 800 - ii * 5, 600 - ii * 5, -1
Next ii
End If
Next i
Loop
End Sub
Private Sub Command2_Click()
bool = True
End Sub
Private Sub Form_Load()
Command1.Caption = "¿ªÊ¼"
Command2.Caption = "½áÊø"
End Sub
[此贴子已经被作者于2007-6-24 15:01:21编辑过]