Microsoft Foundation Classes (mfc.hlp) (Table of Contents; Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
CWnd::CreateGrayCaret
CWnd                                        Up Contents Index Back
──Microsoft Foundation Classes──────────────────────────────────────────────
 
  void CreateGrayCaret( int nWidth, int nHeight );
 
  Parameter   Description
 
  <nWidth>    Specifies the width of the caret (in logical units). If this
              parameter is 0, the width is set to the system-defined
              window-border width.
 
  <nHeight>   Specifies the height of the caret (in logical units). If
              this parameter is 0, the height is set to the system-defined
              window-border height.
 
  Remarks
 
  Creates a gray rectangle for the system caret and claims ownership of
  the caret. The caret shape can be a line or a block.
 
  The parameters <nWidth> and <nHeight> specify the caret's width and
  height (in logical units); the exact width and height (in pixels) depend
  on the mapping mode.
 
  The CreateGrayCaret member function automatically destroys the previous
  caret shape, if any, regardless of which window owns the caret. Once
  created, the caret is initially hidden. To show the caret, the
  ShowCaret member function must be called.
 
  The system caret is a shared resource. CWnd should create a caret only
  when it has the input focus or is active. It should destroy the caret
  before losing the input focus or becoming inactive.
 
  The system's window-border width or height can be retrieved by using the
  GetSystemMetrics Windows function with the SM_CXBORDER and SM_CYBORDER
  indexes. Using the window-border width or height ensures that the caret
  will be visible on a high-resolution display.
 
  See Also
 
  ::DestroyCaret, ::GetSystemMetrics, CWnd::ShowCaret,
  ::CreateCaret
 
 
                                     -♦-