About the basic operation of the CProgressCtrl control there is a lot of information on the web, but I want to achieve the progress of the progress bar scrolling effect, that is, many times the program appears to wait or start the screen, such as:
The function to achieve this effect is Setmarquee (_in_ BOOL fmarqueemode, _in_ int ninterval), the first parameter is a switch, and the second parameter specifies the scrolling time. And the control should contain
Pbs_marquee style, eg:
M_progressctl.create (ws_child| ws_visible| Pbs_marquee,crect (100,200,250,230), this,11);
M_progressctl.setmarquee (TRUE, 30);
If you use the progress bar control with Pbs_marquee style under Win32, you also need to specify that the version of the COMCTL32 library used by the program must be 6.0 or more, because the control library will follow
Internet Explorer, so the currently active COMCTL32 version is probably not the same as the OS version, so we should manually specify the version of the COMCTL32 that the program uses:
#ifDefined _m_ix86#pragmaComment (linker, "/manifestdependency:\" Type= ' Win32 ' Name= ' Microsoft.windows.common-controls ' version= ' 6.0.0.0 ' Processorarchitecture= ' x86 ' publickeytoken= ' 6595b64144ccf1df ' language= ' * ' "")#elifDefined _m_ia64#pragmaComment (linker, "/manifestdependency:\" Type= ' Win32 ' Name= ' Microsoft.windows.common-controls ' version= ' 6.0.0.0 ' Processorarchitecture= ' ia64 ' publickeytoken= ' 6595b64144ccf1df ' language= ' * ' "")#elifDefined _m_x64#pragmaComment (linker, "/manifestdependency:\" Type= ' Win32 ' Name= ' Microsoft.windows.common-controls ' version= ' 6.0.0.0 ' Processorarchitecture= ' amd64 ' publickeytoken= ' 6595b64144ccf1df ' language= ' * ' "")#else#pragmaComment (linker, "/manifestdependency:\" Type= ' Win32 ' Name= ' Microsoft.windows.common-controls ' version= ' 6.0.0.0 ' Processorarchitecture= ' * ' publickeytoken= ' 6595b64144ccf1df ' language= ' * ' "")#endif
We will see a "Common Control manifest" option when creating an MFC project, and if we remove the selection it will find that some of the program's controls are old-fashioned, which
The fact is that the lower version of the COMCTL32 library is used, so in Win32, if you want the control style to be the new system style, you should specify the COMCTL32 version to use.
Win32 controls at a Glance: https://msdn.microsoft.com/en-us/library/bb773169 (v=vs.85). aspx
Progress bar control CProgressCtrl implement progress scrolling effect