C++Builder logo
TProgressBar in 'Marquee' mode TProgressBar en mode 'Marquee'
 
If you're running Windows XP, you can put your TProgressBar in 'Marquee' mode. That means that the progress bar moves like a marquee. It may be useful when you have to report that a progress is being made but you don't know when it will be completed.
Note that this is only available with Windows XP since at least the version 6 of the commctrl.dll is needed and this dll version is only distributed with XP. Besides, you have to include a manifest to your application to tell Windows to use that version 6. To do that, simply add a TXPManifest to your application if you're using BDS2006 or see this link if you use another version of BCB.
Si vous avez Windows XP, vous pouvez utiliser vos ProgressBars en mode 'Marquee'. Ce mode de défilement est utile lorsque vous voulez montrer qu'une action est en cours mais sans savoir quand elle se terminera.
Ce mode n'est disponible qu'avec Windows XP parce qu'il nécessite la version 6 de la commctrl.dll et que cette DLL n'est distribuée qu'avec XP. De plus, vous devrez inclure un manifest à votre application pour indiquer à Windows que vous voulez utilisez cette version de la DLL. Ceci se fait facilement en ajoutant un TXPManifest à votre application si vous compilez sous BDS2006 ou suivez les indications données dans ce lien pour toute autre version de BCB.

#define PBM_SETMARQUEE (WM_USER+10)
#define PBS_MARQUEE 0x08

long style = GetWindowLong(ProgressBar1->Handle, GWL_STYLE);
style = style | PBS_MARQUEE;
SetWindowLong(ProgressBar1->Handle, GWL_STYLE, style);

// To start the marquee
ProgressBar1->Perform(PBM_SETMARQUEE,true,100);
...
// To stop the marquee
ProgressBar1->Perform(PBM_SETMARQUEE,false,100);