This is actually called a cursor, not a cursor. Probably where the confusion came from, and why the search for a solution did not bring much benefit. NullPonyPointer 's comment reflects this general confusion. The SetCursor function SetCursor really what you would like to change with the mouse cursor, but it will not work to change the caret.
Fortunately, there is a whole group of Windows functions that work with carriages: CreateCaret , ShowCaret , HideCaret , SetCaretPos and DestroyCaret . There are other ways to manipulate blinking times, but I recommend sticking with your current user settings (which will be the default).
First, a little background. I highly recommend reading the two introductory MSDN articles on carriages and using CARETS . But here is a brief summary: the carriage belongs to the window; in particular, the window that is currently focused. This window will most likely look like a text box control. When a window gains focus, it creates a carriage for use, and then when it loses focus, it destroys its carriage. Obviously, if you do not do this manually, you will get a standard implementation.
Now an example code. Since I like the interfaces of conveyor machines, I would wrap it in a function:
bool CreateCustomCaret(HWND hWnd, int width, int height, int x, int y) {
Then, in response to WM_SETFOCUS , EN_SETFOCUS or a similar notification, I would call the CreateCustomCaret function. And in response to WM_KILLFOCUS , EN_KILLFOCUS or another similar notification, I would call DestroyCaret() .
Alternatively, CreateCustomCaret can create a CreateCustomCaret from a bitmap. I can provide the following overload:
bool CreateCustomCaret(HWND hWnd, HBITMAP hbmp, int x, int y) {