简体   繁体   中英

Showing cursor in background console window

I have a little Windows API task I can't rule out.

I need to make cursor visible in the background console window. I tried using GetConsoleCursorInfo / SetConsoleCursorInfo but bVisible in CONSOLE_CURSOR_INFO was already true.

How can do it?

Thanks for your answers.

The cursor is only visible when the console window is the foreground window.

I suppose you could check if GetConsoleWindow() != GetForegroundWindow() with a timer and change the text and/or background color with WriteConsoleOutputAttribute when you are not in the foreground if you need some type of visual indicator.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM