CSSetLine Function

Description

Changes the content of a line in the Consoul window queue.

Syntax

VB/A 32bits

Private Declare Function CSSetLine Lib "consoul_010205_32.dll" ( _
  ByVal hWnd As Long, _
  ByVal iLine As Integer, _
  ByVal lpszString As Long, _
  ByVal wNoParsing As Integer, _
  ByVal wNoUpdate As Integer _
) As Integer

VB/A 64bits

Private Declare PtrSafe Function CSSetLine Lib "consoul_010205_64.dll" ( _
  ByVal hWnd As LongPtr, _
  ByVal iLine As Integer, _
  ByVal lpszString As LongPtr, _  
  ByVal wNoParsing As Integer, _
  ByVal wNoUpdate As Integer _
) As Integer

Return Value

The return value is 1 if the line content was replaced, or 0 (zero) if iLine is not a valid line number.

Parameters

hWnd

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

iLine

The number of the line (as returned by CSPushLine) for which you want to change the contents.

lpszString

Address of the zero terminated unicode string to push.

NULL (or zero) can be passed to push a virtual line; Consoul will call back for the contents, when it's needed.

wNoParsing

0 (zero) or 1 (one). If 0 (zero) the text in lpszString is not parsed for escape sequences.

wNoUpdate

The function automatically repaints the affected line only if auto redraw is on. If this flag is 0 (zero) the changes will not be visible until the window has to repaint the line, or a function that forces the repainting like CSRedrawLine is called, although auto redraw still has to be on.

Remarks

When in continous mode (as opposed to in by line mode), if a font property is changed (like bold switched on) with an escape sequence, but is not restored at the end of line, the lines following the updated one will not reflect the change(s) as they are not redrawn. In this case, call CSRefreshWindow, or, either call CSRedrawLine for each line that you know will be affected, or make sure you restore the correct font attributes at the end of the modified text line.

Last updated: May 13 2022.