Graphical Progress Bar

This is a way to display a graphical progress bar while processing documents during a collection.
Option Public
Const NPB_TWOLINE% = 1
Const NPB_STATUSBAR% = 32
Declare Function NEMProgressBegin Lib "nnotesws.dll" ( Byval wFlags As Integer ) As Long
Declare Sub NEMProgressDeltaPos Lib "nnotesws.dll" ( Byval hwnd As Long, Byval dwIncrement As Long )
Declare Sub NEMProgressEnd Lib "nnotesws.dll" ( Byval hwnd 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, Byval pcszLine1 As String, Byval pcszLine2 As String )
Dim hwnd As Long
Dim i As Long
Dim j As Long
Sub Initialize

' In this example I'll grab a document collection and loop through the documents while displaying the progress.

Dim ws As New NotesUIWorkspace
Dim s As New NotesSession
Dim db As NotesDatabase
Dim doc As Notesdocument
Dim collection As NotesDocumentCollection
Dim c As Integer

Set db = s.CurrentDatabase

Set collection = db.AllDocuments '...grab all of the documents in the current database

c = collection.count '...get the number of documents returned

'... create graphical progress bar

hwnd = NEMProgressBegin( NPB_TWOLINE )

NEMProgressSetBarRange hwnd, c

NemProgressSetText hwnd, NTitle, Cstr(c)+" document(s) Found ..."
'..display initial information on the bar

For i = 1 To c

'... Update the progress bar

NEMProgressSetText hwnd, NTitle, "Opening document #" + Cstr(i) + "
... "
NEMProgressSetBarPos hwnd, i

Set doc = collection.GetNthDocument(i)

'...do any document processing here...

Next

'...Destroy the progress bar when we are finished
NEMProgressEnd hwnd

End Sub

Dig Deeper on Domino Resources

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close