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

  • Hundreds of millions of users have adopted public cloud storage solutions to satisfy their Private Online File Sharing and Collaboration (OFS) needs. With new headlines on cloud privacy issues appearing almost daily, the need to explore private alternatives has never been stronger. Join ESG Senior Analyst Terri McClure and Connected Data in this on-demand webinar to take a look at the business drivers behind OFS adoption, how organizations can benefit from on-premise deployments, and emerging private OFS …

  • Live Event Date: December 11, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT Market pressures to move more quickly and develop innovative applications are forcing organizations to rethink how they develop and release applications. The combination of public clouds and physical back-end infrastructures are a means to get applications out faster. However, these hybrid solutions complicate DevOps adoption, with application delivery pipelines that span across complex hybrid cloud and non-cloud environments. Check out this …

Most Popular Programming Stories

More for Developers

RSS Feeds