Click here to Skip to main content
Click here to Skip to main content

CTimerScroll class

, 23 Jan 2001
Rate this:
Please Sign up or sign in to vote.
Helper class to handler the mouse cursor movement near to client's area borders
<!-- Link to source file download -->
  • Download source files - 3 Kb
  • <!-- Link to demo file download -->
  • Download demo project - 31 Kb
  • <!-- Article image -->

    Sample Image - TimerScroll.gif

    <!-- Add the rest of your HTML here -->

    Introduction

    This class is useful for scrolling CWnd derived objects, for example CScrollView, and helps you to handle mouse cursor movement near the client's border. The CTimerScroll object sends WM_HSCROLL and WM_VSCROLL messages to your object.

    It has only 3 methods:

    1. Register(CWnd* pWnd) - Registers the windows object to send messages to.
    2. Install() - Installs the timer and captures the mouse cursor
    3. Unistall() - Helper method to unistall the timer.

    How to use

    1. Insert a CTimerScroll object in your CWnd derived class.
    2. Invoke Register in your init creation process. For example OnInitialUpdate, OnCreate, ....
    3. In the OnLButtonDown message handler, call Install(), this method capture the mouse for you.
    4. In the OnLButtonUp message handler, call ReleaseCapture, to release the mouse. This unistall the timer automatically.

    Of course you must handle the scrolling messages.

    Sample code

    The TSSample sample is a MFC SDI VC++6 aplication sample, and uses the CTimerScroll. The TSSampleView is derived from CScrollView (this MFC class have scroll handler methods build in).

    License

    This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

    A list of licenses authors might use can be found here

    Share

    About the Author

    José Alfredo Morón P.
    Systems Engineer
    Venezuela Venezuela
    No Biography provided

    Comments and Discussions

     
    GeneralProblems PinmemberAnonymous8-Mar-02 18:37 

    General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

    Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

    | Advertise | Privacy | Terms of Use | Mobile
    Web03 | 2.8.1411028.1 | Last Updated 24 Jan 2001
    Article Copyright 2001 by José Alfredo Morón P.
    Everything else Copyright © CodeProject, 1999-2014
    Layout: fixed | fluid