Device Manage for OS/2

DevCon for OS/2 - Developer Connection

Operating systems:
ArcaOS, eComStation, IBM OS/2 Warp
eComStation myths 




/ Guidelines: Additional control elements / Progress-bar / Usage of Progress-bar

Usage of Progress-bar

In PROGRESS.DLL version 2.0 PrgShowDlg() function changed. New features were added, but backwards compatibility was preserved, so additional parameters are optional. Here is new syntax:

HWND APIENTRY PrgShowDlg(HWND hwndParent,      // Progress dialog parent window
                         HWND hwndOwner,       // Progress dialog owner window
                         USHORT fsFlags,       // Flags to specify properties 
                                               // of the Progress   Dialog. 
                                               // PRS_* constants are to be used.
                         HMODULE hmodResource, // Module handle of the resource 
                                               // file. Use -1 for PROGRESS.DLL, 
                                               // 0 - for executable, 
                                               // other - module handle, obtained 
                                               // with DosLoadModule call.
                         ULONG ulIcon,         // Resource ID of the PNG 
                                               // sequence in the hmodResource. 
                                               // For PROGRESS.DLL ID_PROGRESS_PNG_ICON* 
                                               // constants to be used. Ignored if 
                                               // PRS_ICON flag is not set.
                         ULONG ulBar,          // Resource ID of the pair of PNG images 
                                               // in the hmodRsource. For PROGRESS.DLL 
                                               // ID_PROGRESS_PNG_BAR constant to be used. 
                                               // Ignored if PRS_BAR and PRG_IMAGE flags 
                                               // are not set.
                         USHORT usId,          // Progress Bar dialog control ID. Used 
                                               // to recognize Progress Dialog among 
                                               // other controls and to determine command 
                                               // value of WM_COMMAND message sent by 
                                               // Progress Dialog to its owner, when 
                                               // user tries to interrupt a process.
                         PSZ pszTitle,         // Title of the dialog control. If NULL, 
                                               // progress dialog window have no 
                                               // titlebar and no frame.
                         PSZ pszButton1,       // Caption on the button to allow user 
                                               // to interrupt process. If NULL no button 
                                               // apperas in the dialog and process cannot 
                                               // be interrupted.
                         PSZ pszCaption1,      // The first (topmost) caption in the 
                                               // dialog. Could be NULL, if the caption 
                                               // is unused
                         PSZ pszCaption2,      // The second caption in the dialog. Could 
                                               // be NULL, if the caption is unused
                         PSZ pszCaption3,      // The third caption in the dialog. 
                                               // Could be NULL, if the caption is 
                                               // unused. If this caption is too 
                                               // long it will be broken into several lines.
                        [PSZ pszButon2[ ,      // Button 2 caption. Significant 
                                               // only when PRS_BUT_2 flag is specified.
                         PSZ pszButton3[ ,     // Button 3 caption. Significant only when 
                                               // PRS_BUT_3 flag is specified.
                         PSZ pszButtonHelp[ ,  // Help Button caption. Significant 
                                               // only when PRS_BUT_HELP flag is specified.
                         LANGE hLange]]]]);    // LANGE handle. Significant only 
                                               // when PRS_OWNLANGE flag is specified.

As you can see, in version 2.0 progress dialog can contain up to 3 action buttons and one help button, Just specify appropriate PRS_BUT_* flag and button caption parameter. You can also specify LANGE handle to let PROGRESS.DLL automatically translate all captions using LANGE library.

Another additional flag is PRS_DISMISS. If this flag is set, progress bar dialog will be automatically dismissed, when any action button (not help button) is clicked. Otherwise, dialog will not be dismissed, WM_COMMAND message will be posted to the dialog's owner instead.



(C) OS2.GURU 2001-2024