CSSetMouseCursor Function

Description

This function can change the Win32 API mouse cursor that a Consoul window displays when the cursor hovers it. To change the cursor, the host must provide a valid Win32 API mouse cursor handle (HCURSOR) to this function.

To restore the mouse cursor to its default, 0 (zero) must be passed as the handle, in hCursor.

Syntax

VB/A 32bits

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

VB/A 64bits

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

Return Value

The return value is 1 (one), or 0 (zero) if the passed Consoul window handle (hWnd) is not a valid one.

Parameters

hWnd

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

Remarks

Consoul windows display the default arrow mouse cursor (IDC_ARROW) by default.

The host is responsible for creating the cursor and passing its handle to the Consoul library via this function. The host should take care of disposing of it only after having reset it to its default value by passing (HCURSOR)0 (zero) to this function.

Last updated: May 13 2022.