Visual Basic - ProgressBar en Barra de Tareas

Life is soft - evento anual de software empresarial
 
Vista:

ProgressBar en Barra de Tareas

Publicado por Rafael López (1 intervención) el 17/05/2005 15:06:04
Por favor si alguien pudiera suministrarme una rutina para colocar un ProgressBar en Barra de Tareas. Gracias
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

ProgressBar en trayBar 1º parte

Publicado por Benjo (679 intervenciones) el 21/05/2005 06:10:29
Dim CurrentPercent As Integer
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
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 Function GetWindowRect Lib "user32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Sub Form_Load()
MsgBox ("Look at you clock at System Tray")
Dim hWnd As Long, rctemp As RECT
hWnd = FindWindow("Shell_TrayWnd", vbNullString)
hWnd = FindWindowEx(hWnd, 0, "TrayNotifyWnd", vbNullString)
'hWnd = FindWindowEx(hWnd, 0, "TrayClockWClass", vbNullString) 'uncomment
'this string and look progressbar only at clock
GetWindowRect hWnd, rctemp
With Me
.Top = 0
.Left = 0
.Height = Me.Height * (rctemp.Bottom - rctemp.Top) / Me.ScaleHeight
.Width = Me.Width * (rctemp.Right - rctemp.Left) / Me.ScaleWidth
End With
Timer.Enabled = True
SetParent Me.hWnd, hWnd
Picture1.Height = Me.ScaleHeight
Picture1.Width = Me.ScaleWidth
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

ProgressBar en TrayBar 2º Parte

Publicado por Benjo (679 intervenciones) el 21/05/2005 06:12:01
Private Sub Form_DblClick()
MsgBox ("Please, Vote me")
Unload Me
End Sub
Private Sub Picture1_Click()
MsgBox ("Please, Vote me")
Unload Me
End Sub
Private Sub Form_Resize()
Picture1.Top = (Me.ScaleHeight - Picture1.Height) / 2
End Sub
Public Function UpdateProgress(pb As Control, ByVal Percent)
Dim Num$
If Not pb.AutoRedraw Then
pb.AutoRedraw = -1
End If
pb.Cls
pb.ScaleWidth = 100
pb.DrawMode = 10
Num$ = Format$(Percent, "###") + "%"
pb.CurrentX = 50 - pb.TextWidth(Num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(Num$)) / 2
pb.Print Num$
pb.Line (0, 0)-(Percent, pb.ScaleHeight), , BF
pb.Refresh
End Function
Private Sub Timer_Timer()
CurrentPercent = CurrentPercent + 1
If CurrentPercent < 101 Then
UpdateProgress Picture1, CurrentPercent
Else
Timer.Enabled = False
CurrentPercent = 0
End If
End Sub
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar