CClockCtrl v1.12
Welcome to CClockCtrl, 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. A demo app is provided which demos the
control as shown below:

History
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 noticable flicker which sometimes occurred when the seconds hand
moved.
v1.0 (1 February 2000)
Usage
To use CClockCtrl in your project simply include ClockCtrl.cpp/h from the test
application in your application and #include "ClockCtrl.h" in whichever
files you want to use the class in. You can then use the class just like you would
use an ordinary static control anywhere. The public methods CClockCtrl should be
pretty self explanatory by having a look at the CClockCtrl header file.
You should also have a look at the CPJClockView::OnCreate() code in the sample
application.
Contacting the Author
PJ Naughter
Email: pjna@naughter.com
Web: http://www.naughter.com
7 May 2022