CSSetCaretBlinkMs Function

Description

Sets the caret blinking time im milliseconds. Setting the time to 0 (zero) milliseconds stops the blinking.

Consoul doesn't use a standard WinAPI caret, but instead, it draws its own rectangle using the Win32 API InvertRect() function. The shape of the caret is always a rectangle, and its size can be changed with the CSGetCaretWidth and CSGetCaretHeight Consoul API functions.

Syntax

VB/A 32bits

Private Declare Function CSSetCaretBlinkMs Lib "consoul_010205_32.dll" ( _
  ByVal hWnd As Long, _
  ByVal wMillisecs As Integer _
) As Integer

VB/A 64bits

Private Declare PtrSafe Function CSSetCaretBlinkMs Lib "consoul_010205_64.dll" ( _
  ByVal hWnd As LongPtr, _
  ByVal wMillisecs As Integer _
) As Integer

Return Value

The return value is the previous caret blinking time. When 0 (zero) is returned, it's either because the previous caret blinking time was 0 (zero), ie it was not blinking, or because hWnd is not a valid Consoul window handle; there's actually no ways of distinguishing both meanings.

Parameters

hWnd

The window handle (HWND) of the Consoul window, as returned by CSCreateLogWindow.

wMillisecs

The number of milliseconds between each caret blinking state.

Remarks

Consoul doesn't do any validity check on the caret position. You can create a empty console window and have the caret positioned even outside of the visible area.

Last updated: May 13 2022.