News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

CreateCaret Disappearing problems...

Started by travism, May 15, 2009, 10:05:27 AM

Previous topic - Next topic

travism

So I read some of the CreateCaret stuff on this site and then I figured Id have a go at it, I just have a textbox on my form and in the WM_SETFOCUS i have: (Mind you im using goasm)


invoke CreateCaret,[hWnd],NULL,10,20
invoke ShowCaret,[hWnd]


It works when i run the program and shows a block caret but as soon as I click on the edit box it goes away.. any idea how to make it stay there?

travism

Ok well I thought I got it working with invoke SetFocus on the editbox but that still doesnt work... Any other ways?

Tedd

It should work..

on WM_SETFOCUS:
    invoke CreateCaret, .....
    invoke ShowCaret, ...
on WM_KILLFOCUS:
    invoke DestroyCaret


However, that assumes it's your control, if you're trying to do this on an edit control, it will already be handling the caret as well, so there will be some interference.
No snowflake in an avalanche feels responsible.

travism

Ya I want the caret to be shown as a block in the edit control.. I will try that code some bit, thanks! :)

EDIT: So i tried it and it still doesnt work, as soon as the editbox gets control the caret created goes back to normal. and sometimes depending on if i have the edit set to be focused when the form loads it doesnt even show the created caret. :(

travism

Hmm ok now its not even working :\...... Is it even possible to keep the caret changed ina  textbox? ive searched the forums and there is like nothing on it..