Private Sub ShowProgressInStatusBar(ByVal bShowProgressBar As Boolean)
Dim tRC As RECT
If bShowProgressBar Then
SendMessageAny StatusBar1.hwnd, SB_GETRECT, 1, tRC
With tRC
.Top = (.Top * Screen.TwipsPerPixelY)
.Left = (.Left * Screen.TwipsPerPixelX)
.Bottom = (.Bottom * Screen.TwipsPerPixelY) - .Top
.Right = (.Right * Screen.TwipsPerPixelX) - .Left
End With
With ProgressBar1
SetParent .hwnd, StatusBar1.hwnd
.Move tRC.Left, tRC.Top, tRC.Right, tRC.Bottom
.Visible = True
.Value = 0
End With
Else
SetParent ProgressBar1.hwnd, Me.hwnd
ProgressBar1.Visible = False
End If
End Sub