CSReplaceZone Function

Description

Consoul will replace all the content that is between the ZONE_START and ZONE_END escape sequences, for the first matching zone ID it finds, with the specified content by the unicode zero terminated string pointed by lpszReplaceBy.

Syntax

VB/A 32bits

Private Declare Function CSReplaceZone Lib "consoul_010205_32.dll" ( _
  ByVal hWnd As Long, _
  ByVal wLine As Integer, _
  ByVal wZoneID As Integer, _
  ByVal lpszReplaceBy As Long, _
  ByVal wNoParsing As Integer _
) As Integer

VB/A 64bits

Private Declare PtrSafe Function CSReplaceZone Lib "consoul_010205_64.dll" ( _
  ByVal hWnd As LongPtr, _
  ByVal wLine As Integer, _
  ByVal wZoneID As Integer, _
  ByVal lpszReplaceBy As LongPtr, _
  ByVal wNoParsing As Integer _
) As Integer

Return Value

The return value is 1 (one) if Consoul was able to replace the zone content; it is 0 (zero) otherwise.

Parameters

hWnd

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

wLine

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

wZoneID

The zone number for which we want to replace the content. Consoul will change the content of the first zone it finds on the line with this zone ID; other instances of the zone on the same line cannot be reached by this function.

lpszReplaceBy

Address of the zero terminated unicode string that is the new zone content.

wNoParsing

0 (zero) or 1 (one). Text can contain Consoul compatible vt100 escape sequences, that will be parsed and applied. When wNoParsing is not zero, Consoul won't do any parsing, and replace the zone content as is.

Remarks

Any content, including zones, between the replaced zone escape sequences delimiters, is ovewritten. If the zone has no matching ZONE_END escape sequence, it extends until the end of the line. The line must be repainted to visually apply the changes.

The inverse of this function is CSGetZoneText.

Last updated: May 13 2022.