How can I make a custom cursor's color change depending on the background color, just like the system default cursor behaves?

censv 40 Reputation points
2023-12-19T09:32:51.95+00:00

For example, the system default text selection cursor (Ibeam). When the background color is white, it is black. When the background color is black, it becomes white again. And when selecting text, its color keeps changing with the background color.

1

2

3

But with my custom red cursor(using WinAPI SetSystemCursor function), it just displays red no matter what the background color is. When the background color is red, the cursor blends in with the background and can't be seen anymore!

4

5

6

7

Windows development | Windows API - Win32
{count} votes

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.