CSSetColorTransparency Function

Description

Turns ON or OFF the percentage level of a color transparency for a Consoul window.

Syntax

VB/A 32bits

Private Declare PtrSafe Function CSSetColorTransparency Lib "consoul_010205_32.dll" ( _
  ByVal hWnd As Long, _
  ByVal bPercent As Byte, _
  ByVal lColorRef As Long, _
  ByVal bEnabled As Byte _
) As Integer

VB/A 64bits

Private Declare PtrSafe Function CSSetColorTransparency Lib "consoul_010205_64.dll" ( _
  ByVal hWnd As LongPtr, _
  ByVal bPercent As Byte, _
  ByVal lColorRef As Long, _
  ByVal bEnabled As Byte _
) As Integer

Return Value

The return value is meaningless.

Parameters

hWnd

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

bPercent

Valid range is [0..100].

A value of 0 (zero) restores full opacity for the Consoul window.

lColorRef

The RGB color value for which we want to enable or disable transparency.

bEnabled

Either 0 (zero) to disable color transparency, or 1 (one) to enable it with the percentage level specified in bPercent.

Remarks

A Consoul window cannot have alpha and color transparency at the same time, it's one or the other. If an alpha transparency percentage was previously set (CSSetAlphaTransparency), it must be set back to zero before calling this function.

Windows version < 8 does not support color or alpha channel transparency for non top level windows, meaning that CSSetAlphaTransparency will have no effect on those OSes for Consoul windows created with an hwndParent <> 0 (zero) with CSCreateLogWindow.

Last updated: May 13 2022.