下面这段代码如何用?没看懂。。各位帮忙看看
Public Property Let Progress(Percent As Single)
If Percent < 0 Then
hWndTray = 0
SetCursorPos CursorPos.x, CursorPos.y
Unload Me
Else
If hWndTray = 0 Then
GetCursorPos CursorPos 'save cursor pos
hWndTray = FindWindowEx(FindWindow( "Shell_TrayWnd ", " "), 0, "TrayNotifyWnd ", " ") 'find tray
GetWindowRect hWndTray, WindowRect
With WindowRect
Width = (.Right - .Left - 2) * 15 'adjust my size
Height = (.Bottom - .Top - 2) * 15
End With
PrintY = (ScaleHeight - TextHeight( "A ")) / 2 'vertical print pos
SetParent hWnd, hWndTray 'tray is my parent
ScaleWidth = 100 'percent
FColor = ForeColor 'colors...
If FColor < 0 Then
FColor = GetSysColor(FColor And &H7FFFFFFF)
End If
BColor = BackColor
If BColor < 0 Then
BColor = GetSysColor(BColor And &H7FFFFFFF)
End If
BColor = Not (FColor Xor BColor)
Show
End If
With Screen
SetCursorPos .Width / .TwipsPerPixelX, .Height / .TwipsPerPixelY 'to make tray visible
End With
PrintPercent = Int(Percent) & "% "
Cls
CurrentX = 50 - TextWidth(PrintPercent) / 2
CurrentY = PrintY
Print PrintPercent
Line (0, 0)-(Percent, Height), BColor, BF
End If
End Property