Progress bar control CProgressCtrl implement progress scrolling effect

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.