This function sets or returns the color of the cursor.

Syntax

long SetCursorColor(
  long rgb
);

Parameters

rgb
[in] Specify the cursor color to set.
ValueDescription
0xRRGGBB Optional specification (RR: red, GG: green, BB: blue)
RGB_WHITE White (0xFFFFFF)
RGB_RED Red (0xFF0000)
RGB_GREEN Green (0x00FF00)
RGB_BLUE Blue (0x0000FF)
RGB_MAGENTA Magenta (0xFF00FF)
RGB_CYAN Cyan (0x00FFFF)
RGB_YELLOW Yellow (0xFFFF00)
RGB_BLACK Black (0x000000)
CURRENT_MODE Returns the current settings without changing the settings.

Return value

Returns the background color before the change.

Remarks

This setting does not affect the contents of the displayed screen.

Requirements

Header file:
lib.h
Library file:
libSTARTUPOPH5000.a

Sample

#include <stdio.h>
#include "lib.h"

void main(void)
{
    long	cursorColor;
    printf("[SetCursorColor]\n");
    printf("Please any key\r");
    ResetKey();
    while(!kbhit())
        Idle();
    cursorColor	=	SetCursorColor(RGB_BLUE);
    Cursor(ON);
    printf("Cursor:blue\n");
    printf("Please any key\r");
    ResetKey();
    while(!kbhit())
        Idle();
    SetCursorColor(cursorColor);
}

Last updated: 2022/03/09