Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Code for a progess bar
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01558622
Message ID:
01558650
Views:
109
Likes (1)
Progress Dialog Library (FLL) for Visual FoxPro
http://www.news2news.com/vfp/?solution=11

Progress Dialog FLL is a wrapper around IProgressDialog interface implemented in Shell32.dll. It exposes methods allowing Visual FoxPro application to display a progress dialog box.

Demo version is available. The full version includes complete C++ code.

Usage:
SET LIBRARY TO vfpProgressDialog.fll
 
* Sets the title of the progress dialog box
pd_SetTitle('Shipping and handling')
 
* Displays a message in the progress dialog: lines 1,2,3 are available
pd_SetLine(1, 'Running database daily maintenance')  && 1st line
pd_SetLine(2, 'Removing invalid product orders...')  && 2nd line
 
* Sets a message to be displayed if the user cancels the operation
pd_SetCancelMsg('Please wait while we cancel the processing...')
 
* starts the dialog as a child to main VFP window, 
* with flags PROGDLG_AUTOTIME and PROGDLG_NOMINIMIZE
pd_StartDialog( _screen.HWnd, 10)  && 11, 32+3, 32+3+64
 
* Animation to be displayed - WinXP only
* Shell32 AVI #172: moving files to the Recycle Been
pd_SetAnimation( 162 ) && try other Ids in [160..170] range
 
* Emulates a time consuming process
FOR nIndex = 1 TO 100
 
    pd_SetProgress(nIndex)
    = INKEY(0.5)
 
    * Important: the OS sends _no_ messages to the application 
    * when the user clicks the Cancel button. 
    *
    * VFP application must _periodically_ call pd_HasUserCancelled function 
    * to determine whether the operation has been canceled.
    IF ( pd_HasUserCancelled() )
        EXIT
    ENDIF
 
NEXT
 
* Stops the progress dialog box and removes it from the screen
pd_StopDialog()
Previous
Reply
Map
View

Click here to load this message in the networking platform