ProgressBar by API in statusbar R5 vs R6

Hi, I have this script. It works perfectly in R5, but in R6 nothing…

DECLARE

Declare Sub NEMProgressEnd Lib “nnotesws.dll” ( Byval hwnd As Long )

Declare Function NEMProgressBegin Lib “nnotesws.dll” ( Byval wFlags As Integer) As Long

Declare Sub NEMProgressSetBarPos Lib “nnotesws.dll” ( Byval hwnd As Long,Byval dwPos As Long)

Declare Sub NEMProgressSetBarRange Lib “nnotesws.dll” ( Byval hwnd As Long,Byval dwMax As Long )

Declare Sub NEMProgressSetText Lib “nnotesws.dll” ( Byval hwnd As Long, ByvalpcszLine1 As String, Byval pcszLine2 As String )

Sub Click(Source As Button)

Const NPB_STATUSBAR% = 32



Dim hwnd As Long

Dim i As Long

Dim j As Long

'Create the progress bar

hwnd = NEMProgressBegin( NPB_STATUSBAR )

'Set the bar range - the default is 100

NEMProgressSetBarRange hwnd, 200



For i = 0 To 200

'Simple delay for the example!!

	For j = 0 To 100000

		

	Next

'Update the bar position

	NEMProgressSetBarPos hwnd, i

	

Next

'Destroy the dialog when we’re done

NEMProgressEnd hwnd

End Sub

Subject: ProgressBar by API in statusbar R5 vs R6

how about this one, it works for me on 6.0.3 and 6.5Original Author = Unknown…Sorry.

'Note!!!: This will hang notes if you are debugging and there is an error.

Options:

'We need two lines on the progress bar

Const NPB_TWOLINE = 3

Const NPB_ONELINE = 2

Declare:

Declare Public Function NEMProgressBegin Lib “nnotesws.dll” ( Byval wFlags As Integer ) As Long

Declare Public Sub NEMProgressDeltaPos Lib “nnotesws.dll” ( Byval hwnd As Long, Byval dwIncrement As Long )

Declare Public Sub NEMProgressEnd Lib “nnotesws.dll” ( Byval hwnd As Long )

Declare Public Sub NEMProgressSetBarPos Lib “nnotesws.dll” ( Byval hwnd As Long, Byval dwPos As Long)

Declare Public Sub NEMProgressSetBarRange Lib “nnotesws.dll” ( Byval hwnd As Long, Byval dwMax As Long )

Declare Public Sub NEMProgressSetText Lib “nnotesws.dll” ( Byval hwnd As Long, Byval pcszLine1 As String, Byval pcszLine2 As String )

Public Class LNProgressbar

hwnd As Long



Sub New(SecondLineVisible As Integer)

'Set-up the progress bar on the screen

	If SecondLineVisible Then

		hwnd = NEMProgressBegin(NPB_TWOLINE) 

	Else

		hwnd = NEMProgressBegin(NPB_ONELINE)

	End If

End Sub



Sub SetText(FirstLineText As String,SecondLineText As String)

'Display the text in progress bar

	NemProgressSetText hwnd, FirstLineTExt,SecondLineText 

End Sub



Sub SetProgressPos(Progresspos As Long)

	NEMProgressSetBarPos hwnd, ProgressPos 

End Sub



Sub SetProgressRange(ProgressMaxElements As Long)

'Set-up the max elements in the progress bar, if you have

'a list with 230 elements then set the MAX to 230 elements.

'For every element you proceed increase the SetProgressPos

'by one to reached 230

	NEMProgressSetBarRange hwnd, ProgressMaxElements

	

End Sub



Sub DeltaPos(DPos As Long)

’ This function adds the number in DPOS to the current ProgressPos

	NEMProgressDeltaPos hwnd, DPos

End Sub 



Sub Delete

'Terminate the progress bar on the screen

	NEMProgressEnd hwnd

End Sub

End Class

Initialize or onClick of a Button:

Dim pb As New LNProgressBar(True)

Dim t As Long

Dim viewcount As Long

Call pb.SetText("Your Text Here","Please Wait...")

'inside loop

	Call pb.SetProgressRange(viewcount) ' max range of progress bar 

	Call pb.SetProgressPos(t) ' cpt as integer

HTH,

Ben

Subject: Unfortunately, they have dropped support for the “StatusBar” Progress bar in R6. The other 2 styles still work well.

Subject: *To be more clear, these were always unsupported, but that style no longer works.

Subject: *Ah the fun of unsupported functions!