Click here to Skip to main content
13,143,774 members (32,516 online)
Click here to Skip to main content
Add your own
alternative version


26 bookmarked
Posted 25 Jan 2000

ATL Rotary Control

, 25 Jan 2000
Rate this:
Please Sign up or sign in to vote.
A rotary knob similar to that used in the Windows 2000 CD Player
  • Download source files - 67 Kb
  • Sample Image - rotary.gif

    <!-- Article Starts -->

    This is an example of a simple ATL rotary control. The control is a copy of the rotary knob found on the Windows 2000 CD Player.

    The control uses a minimum and maximum value, the position is calculation using the following calculated: once the limits are reached).

    double a = -PI/4 + 3*PI/2 * (m_iMax - m_iPos)/(m_iMax - m_iMin);

    The calculation sets the minimum stop at 8 o’clock and the maximum stop is a 4 o’clock. One enhancement that could be made to the project, is the facility for a Jogger button (A button that spins 360 Degrees) increasing a value until the minimum/maximum value is reached (the button still spins, but the value remains the same.

    When the dial is moved a connection point event is fired:

    DialChanged(int nPos)

    This can be picked up in MFC, HTML page, or Visual Basic. The following methods are supported for retrieving and altering the limits and position are:

    [propget, id(1), helpstring("property DialPosition")] HRESULT DialPosition([out, retval] short *pVal);
    [propput, id(1), helpstring("property DialPosition")] HRESULT DialPosition([in] short newVal);
    [id(2), helpstring("method SetMax")] HRESULT SetMax([in] short nMax);
    [id(3), helpstring("method SetMin")] HRESULT SetMin([in] short nMin);

    Any circular bitmap can be using for the background. When the left mouse button is press the LED positional indicator pulses.

    The control has been tested with IE 5.0, Visual Basic 6.0 and MFC. One other thing to mention is that it would be rather simple to port this as MFC based CWnd class, as this how it was developed in the first place.


    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


    About the Author

    Software Developer (Senior) Software Kinetics
    United Kingdom United Kingdom

    Software Kinetics
    are experts in developing customised and bespoke applications and have expertise in the development of desktop, mobile and internet applications on Windows.

    We specialise in:

    • User Interface Design

    • Desktop Development

    • Windows Phone Development

    • Windows Presentation Framework

    • Windows Forms

    • Windows Communication Framework

    • Windows Services

    • Network Applications

    • Database Applications

    • Web Development

    • Web Services

    • Silverlight


    Visit Software Kinetics

    You may also be interested in...


    Comments and Discussions

    QuestionSkinnable? Pin
    Heath Stewart15-Jul-03 5:51
    editorHeath Stewart15-Jul-03 5:51 
    GeneralImplemetation problem Pin
    ""5-Jun-03 23:24
    member""5-Jun-03 23:24 
    GeneralRe: Implemetation problem Pin
    Heath Stewart15-Jul-03 5:47
    editorHeath Stewart15-Jul-03 5:47 
    GeneralControl dissapears Pin
    Anonymous23-Feb-02 12:38
    memberAnonymous23-Feb-02 12:38 
    GeneralRe: Control dissapears Pin
    Anonymous26-Feb-02 12:18
    memberAnonymous26-Feb-02 12:18 
    GeneralRe: Control dissapears Pin
    Norm Almond1-Nov-02 3:05
    memberNorm Almond1-Nov-02 3:05 
    GeneralMFC sample program Pin
    Anonymous20-Feb-02 8:19
    memberAnonymous20-Feb-02 8:19 
    GeneralGreat but ... Pin
    Djibril13-Jan-02 22:13
    memberDjibril13-Jan-02 22:13 
    GeneralRe: Great but ... Pin
    Norm Almond15-Jan-02 21:05
    memberNorm Almond15-Jan-02 21:05 
    GeneralRe: Great but ... Pin
    Djibril15-Jan-02 22:48
    memberDjibril15-Jan-02 22:48 
    GeneralRe: Great but ... Pin
    Norm Almond18-Jan-02 2:12
    memberNorm Almond18-Jan-02 2:12 
    GeneralAlso Linker Error Please Help Pin
    Thorben Burghardt25-Jul-01 20:32
    memberThorben Burghardt25-Jul-01 20:32 
    GeneralRe: Also Linker Error Please Help Pin
    Norm Almond25-Jul-01 21:12
    memberNorm Almond25-Jul-01 21:12 
    Generallinker errors Pin
    Gregory Franz7-Mar-00 9:45
    sussGregory Franz7-Mar-00 9:45 
    GeneralRe: linker errors Pin
    Anonymous4-Mar-02 23:12
    memberAnonymous4-Mar-02 23:12 
    GeneralRe: linker errors Pin
    Almighty1-Nov-02 2:27
    sussAlmighty1-Nov-02 2:27 
    Questionhow do i view the control in the demo? Pin
    -29-Jan-00 2:25
    suss-29-Jan-00 2:25 
    AnswerRe: how do i view the control in the demo? Pin
    harrisonkirk25-Oct-05 9:46
    memberharrisonkirk25-Oct-05 9:46 

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

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

    Permalink | Advertise | Privacy | Terms of Use | Mobile
    Web01 | 2.8.170915.1 | Last Updated 26 Jan 2000
    Article Copyright 2000 by NormDroid
    Everything else Copyright © CodeProject, 1999-2017
    Layout: fixed | fluid