Progress Bar Control Progress bar controls indicate the progress of a lengthy operation such as downloading a file from the Internet. Usually the progress is expressed as a percentage from 0 to 100.
The window class name for a progress bar control is PROGRESS_CLASS, which is defined as \"msctls_progress\" in commctrl.h.
A progress bar\'s range represents the entire duration of the operation, and the current position represents the progress that the application has made toward completing the operation. The window procedure uses the range and the current position to determine the percentage of the progress bar to fill with the highlight color as well as to determine what text, if any, to display within the progress bar.
If you do not set the range values, the system sets the minimum value to zero and the maximum value to 100. You can adjust the range to convenient integers by using the PBM_SETRANGE message.
A progress bar provides several messages that you can use to set the current position. The PBM_SETPOS message sets the position to a specified value. The PBM_DELTAPOS message advances the position by adding a specified value to the current position. The PBM_SETSTEP message enables you to specify a step increment for a progress bar. Subsequently, when you send the PBM_STEPIT message to the progress bar, the current position advances by the specified increment. The default step increment is 10.
Note The range values in a progress bar are considered signed integers. Any number greater than 0x7FFFFFFF is interpreted as a negative number.
< /MSDN >
Du må kunne bruge de messages til at manipulere med den. Det burde bare være noget med nogle \"sendmessage\" :)
wisen >> Jeg ved ikke hvad karlkoder har gjort galt ..... Anyway jeg har tilbudt manden et eksempel det virker ... men indtil videre har jeg ikke hørt fra ham ..... Så problemet er nok ikke så stort ....
hvis man trykker på noget andet end dialogboxen område forsvinder dialogboxen (som de jo plejer) men jeg kan ikke komme tilbage før at den process (unace) som kører / bliver fyldt ud i progressbaren er færdig...
det er bare underligt fordi jeg har jo tegnet en progressbar i editoren, givet den ID osv.. men jeg bruger den ikke på grund af at den jo kører i et WINDOW..
Jammen hvis du har lavet en progressbar i ressourceeditoren, er det ikke nødvendigt bagefter at lave en \"CreateWindow\", det er jo een af de ting du bliver sparet for. Du skal desuden huske af progressbaren er \"child\" af den dialog den ligger på.
Jeg har lige tagen den zip fil jeg sendte dig i går pakket den ud og kompileret eksemplet, og det virker .....
Hvis du ikke bruger windows 2000 som jeg så prøv etv at erstatte CreateWindow med CreateWindow .. Under alle omstendighedder så ved du jo selv hvordam man sætter en progressbar på et vindue så må du jo aselv tilrette metoden void CMainWindow::CreateProgressBar()
Jens B
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.