Hello
I'm having a problem showing the caret in my window. I have a main window and then a child window that covers the entire client area of the main window. In the wndproc of my child window I have this

.elseif uMsg==WM_SETFOCUS
invoke CreateCaret, hWnd, 1, 0, 0
invoke ShowCaret, hWnd
invoke SetCaretPos, 0, 0
.elseif uMsg==WM_KILLFOCUS
invoke HideCaret, hWnd
invoke DestroyCaret

I think this is the correct way of showing a carret but I don't see the blinking line on my window. The only thing I can think of is that my main window has the typing focus but my child window dose not allthought my main window calls the DefWindowProc. Is there something I have to do to pass the typing focus the child window or is there something else I'm not doing in order to show the caret?
thanx
Posted on 2002-01-13 08:56:53 by Quantum
Second parameter of CreateCaret should be a bitmap handle, I suppose you have used the bitamp resource ID (1). Call LoadBitmap/LoadImage with bitmap ID to obtain the hBitamp for CreateCaret.

Edit:
Also look at the Carrot example at http://forger.ca/
Posted on 2002-01-13 09:25:07 by LuHa
if you like the systems default caret, try
this one:


push CARET_HEIGHT
push CARET_WIDTH
push NULL
push hwndMain
call CreateCaret


width and height are own constants, f.e. 1 and 12.
Posted on 2002-01-14 03:51:08 by beaster