GetCaretPos Function

Description

Get the caret position. The caret position is a row/column tuple (y, x).

Syntax

VB/A 32bits

Private Declare Function CSGetCaretPos Lib "consoul_010205_32.dll" ( _
  ByVal hWnd As Long, _
  ByRef wRow As Integer, _
  ByRef wCol As Integer _
) As Integer

VB/A 64bits

Private Declare PtrSafe Function CSGetCaretPos Lib "consoul_010205_64.dll" ( _
  ByVal hWnd As LongPtr, _
  ByRef wRow As Integer, _
  ByRef wCol As Integer _
) As Integer

Return Value

The return value should be always 1 (one). 0 (zero) is returned if hWnd is not a valid Consoul window handle.

Parameters

hWnd

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

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.