Reader small image

You're reading from  C++ Windows Programming

Product typeBook
Published inSep 2016
Reading LevelIntermediate
PublisherPackt
ISBN-139781786464224
Edition1st Edition
Languages
Right arrow
Author (1)
Stefan Björnander
Stefan Björnander
author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander

Right arrow

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 const CursorType Arrow; 
      static const CursorType ArrowHourGlass; 
      static const CursorType Crosshair; 
      static const CursorType Hand; 
      static const...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
C++ Windows Programming
Published in: Sep 2016Publisher: PacktISBN-13: 9781786464224

Author (1)

author image
Stefan Björnander

Stefan Björnander is the author of the books Microsoft Windows C++ and C++ Windows Programming. He holds a Master of Engineering and a Licentiate in Computer Science. He has worked as a software developer and as a teacher in computer science and mathematics for many years.
Read more about Stefan Björnander