The Cursor class

There is a set of cursors available in the Win32 API, all with names starting with IDC_. In Small Windows, they have been given other names, which are hopefully easier to understand. Unlike other cases, we cannot use an enumeration for the cursors, since they are actually zero-terminated C++ strings (character pointers). Instead, every cursor is a pointer to a zero-terminated string. LPCTSTR stands for Long Pointer to Constant TChar String.

The reason the cursor has its own class, while the caret has a method in the Document class is that the caret does need a window handle to be set, while the cursor does not.

Cursor.h

namespace SmallWindows { typedef LPCTSTR CursorType; class Cursor { public: static const CursorType Normal; static ...

Get C++ Windows Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.