Scrolling Support for ATL Composite Controls

Here's a class that I wrote that adds scrolling support to any ATL Composite Control.

The following steps are needed to add scrolling...

  1. Include the ScrollImpl.h file
  2. #include "ScrollImpl.h"
  3. Add CScrollImpl to your inheritance tree
  4. public CScrollImpl
  5. Add the following entry to your Message Map
  6. CHAIN_MSG_MAP(CScrollImpl)
  7. Add a message handler for WM_INITDIALOG and add the following line to OnInitDialog...
  8. SetScrollSize( m_hWnd, xScrollPos, yScrollPos );
  9. Set xScrollPos to the position that you want horizontal scrolling to start and yScrollPos for the position you want vertical scrolling to start.
I've attached a sample workspace that contains the ScrollImpl.h file, a project with a composite control that supports scrolling and an MFC container for the control.

Downloads

Download demo project - 27 Kb


Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Hybrid cloud platforms need to think in terms of sweet spots when it comes to application platform interface (API) integration. Cloud Velocity has taken a unique approach to tight integration with the API sweet spot; enough to support the agility of physical and virtual apps, including multi-tier environments and databases, while reducing capital and operating costs. Read this case study to learn how a global-level Fortune 1000 company was able to deploy an entire 6+ TB Oracle eCommerce stack in Amazon Web …

  • Live Event Date: August 20, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT When you look at natural user interfaces as a developer, it isn't just fun and games. There are some very serious, real-world usage models of how things can help make the world a better place – things like Intel® RealSense™ technology. Check out this upcoming eSeminar and join the panel of experts, both from inside and outside of Intel, as they discuss how natural user interfaces will likely be getting adopted in a wide variety …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds