Graphical Progress Bar
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