CClockCtrl v1.12 An MFC class to display
an analog clock
CClockCtrl is an MFC widget which renders an analog clock. The class is based
in part on the class of the same name from the book "MFC Programming with Visual
C++ 6.0". The class is derived from CStatic and a number of public methods
allow customisation of its look.
The enclosed zip file contains the CClockCtrl
source code and also includes a VC 2017 workspace file to build a small demonstration
app.
Copyright
- You are allowed to include the source code in any product (commercial, shareware,
freeware or otherwise) when your product is released in binary form.
- You are allowed to modify the source code in any way you want except you
cannot modify the copyright details at the top of each module.
- If you want to distribute source code with your application, then you are
only allowed to distribute versions released by the author. This is to maintain
a single distribution point for the source code.
Updates
v1.12 (7 May 2022)
- Updated copyright details.
- Updated the code to use C++ uniform initialization for all variable
declarations.
v1.11 (5 April 2020)
- Updated copyright details.
- Fixed more Clang-Tidy static code analysis warnings in the code.
v1.10 (26 December 2019)
- Fixed various Clang-Tidy static code analysis warnings in the code.
v1.09 (28 September 2019)
- Fixed a number of compiler warnings when the code is compiled with VS
2019 Preview
v1.08 (3 June 2019)
- Updated copyright details.
- Updated the code to clean compile on VC 2019
v1.07 (29 December 2018)
- Updated copyright details.
- Fixed a number of C++ core guidelines compiler warnings. These changes
mean that the code will now only compile on VC 2017 or later.
v1.06 (31 December 2016)
- Updated copyright details.
- Replaced all occurrences of NULL with nullptr throughout the codebase
- Updated the code to clean compile on VC 2010 to VC 2015. The code now requires
VC 2010 at a minimum.
- Added SAL annotations to all the code
v1.05 (23 March 2002)
- Updated Copyright details.
- Fixed a bug where PreSubclassWindow was not calling RecalcLayout before
a redraw was occurring.
v1.04 (11 August 2001)
- Removed Win2k Build configurations and instead put in code into sample app
to at runtime, detect if the OS provides transparency support. This means that
the exe in the distribution will run on any Win32 OS without the need to recompile.
v1.03 (1 August 2001)
- Second hand can now be updated with sub second precision with the "SetSubSecondPrecision"
method.
- Please remember that the included exe will only work on Win2k as it used
some of the new window layering API's. To get the sample app to work on Win9x
or NT 4, recompile the code using one of the non Win2k build configurations.
v1.02 (27 July 2001)
- Fixed a drawing glitch which left the old hour hand being displayed every
12 minutes
- Made most of the functions virtual to allow easier customisation.
- Sample app now can be dragged via left mouse button.
- Sample app now includes always on top functionality.
- Sample app now includes transparent window support (Windows 2000 and later
only). Specific build configurations are included for this. Please note that
you will need the platform SDK installed now to compile these specific configurations.
- Sample app now provides a context menu.
- A new icon as been provided for the sample app.
- Got rid of MFC document / View code in sample as it was not needed.
v1.01 (16 February 2000)
- Removed noticeable flicker which sometimes occurred when the seconds hand
moved.
v1.0 (3 February 2000)