OK. I did ask OpenAI and it suggests doing this instead:
// Set the caret line background color (RGB format)
COLORREF caretLineColor = RGB(240, 240, 240); // Light gray color
SendMessage(hScintilla, SCI_SETCARETLINEBACK, caretLineColor, 0);
// Optionally, set the caret line background transparency (0 to 255)
int alpha = 100; // Transparency level (0 = fully transparent, 255 = fully opaque)
SendMessage(hScintilla, SCI_SETCARETLINEBACKALPHA, alpha, 0);
So I think I'll give it a go. Although I am concerned about possibly clashing with syntax text colours. We'll see.