Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Fri, 11 Jul 2008 20:12:00 -0400,    group: microsoft.public.win32.programmer.ui        back       


Hiding a rich edit caret   
I'm trying to use a read-only rich edit control to display some formatted 
text.  Is there a way to get the rich edit control to hide the input caret?

Thanks.

David Liebtag
date: Fri, 11 Jul 2008 20:12:00 -0400   author:   David Liebtag

Re: Hiding a rich edit caret   
On Jul 11, 5:12 pm, "David Liebtag" 
wrote:
> I'm trying to use a read-only rich edit control to display some formatted
> text.  Is there a way to get the rich edit control to hide the input caret?
>
> Thanks.
>
> David Liebtag



Hi,

The answer is within your question, or should I say you
already answered your question. :-)

	HideCaret()

	ShowCaret()

http://msdn.microsoft.com/en-us/library/ms648403(VS.85).aspx

http://msdn.microsoft.com/en-us/library/ms648406(VS.85).aspx

Kellie.
date: Fri, 11 Jul 2008 19:47:56 -0700 (PDT)   author:   Kellie Fitton

Re: Hiding a rich edit caret   
Kellie,

I already tried HideCaret; it does not hide the rich edit control's caret. 
That's why I asked on the news group.

David
date: Sat, 12 Jul 2008 01:33:05 -0400   author:   David Liebtag

Re: Hiding a rich edit caret   
David Liebtag schrieb:
> I already tried HideCaret; it does not hide the rich edit control's caret. 
> That's why I asked on the news group.

Does HideCaret return True? If not, what does GetLastError say?
Here it's an access violation (5).

-- 
Remember that whatever misfortune may be your lot, it could only be
worse in Cleveland.
		-- National Lampoon, "Deteriorata"

...und wech
          Danny <dannys9 (at) gmx (dot) de>
date: Sat, 12 Jul 2008 09:55:04 +0200   author:   Danny Strümpel dannys9@invalid

Re: Hiding a rich edit caret   
I have tried both HideCaret and DestroyCaret, they both return non-zero 
values.  If I call them again, they return 5.  And yet, the RichEdit control 
continues to show a caret.

I wonder if RichEdit is using a system IME which is in another process and 
so is not affected by the caret APIs?  I've tried making the richedit not 
use an IME and that didn't work either.

David Liebtag
date: Sun, 13 Jul 2008 16:27:01 -0400   author:   David Liebtag

Re: Hiding a rich edit caret   
I assume you are using the correct window handle.

Where are you using HideCaret?


"David Liebtag"  wrote in message 
news:%233xzObS5IHA.4448@TK2MSFTNGP05.phx.gbl...
>I have tried both HideCaret and DestroyCaret, they both return non-zero 
>values.  If I call them again, they return 5.  And yet, the RichEdit 
>control continues to show a caret.
>
> I wonder if RichEdit is using a system IME which is in another process and 
> so is not affected by the caret APIs?  I've tried making the richedit not 
> use an IME and that didn't work either.
>
> David Liebtag
>
>
date: Tue, 15 Jul 2008 07:50:32 -0700   author:   Sam Hobbs _change_social_to_socal

Re: Hiding a rich edit caret   
I have tried using both the handle of the richedit window and NULL (which 
the docs say will cause it to search the current task for the window that 
owns the caret.)  Neither work.

I'm not sure what you mean when you ask where I am using HideCaret.

I create the richedit window with the WS_POPUP and ES_READONLY styles (among 
others).
I send EM_SETTEXTEX the window's text.
I use SetWindowPos to position, size, and activate the window.
I send EM_EXSETSEL to unselect all the characters.
I call HideCaret.

This all happens in response to a mouse click in another window.  (I am 
trying to provide popup information in response to the click.)

David Liebtag
date: Tue, 15 Jul 2008 13:30:42 -0400   author:   David Liebtag

Re: Hiding a rich edit caret   
On Jul 15, 10:30 am, "David Liebtag" 
wrote:
> I have tried using both the handle of the richedit window and NULL (which
> the docs say will cause it to search the current task for the window that
> owns the caret.)  Neither work.
>
> I'm not sure what you mean when you ask where I am using HideCaret.
>
> I create the richedit window with the WS_POPUP and ES_READONLY styles (among
> others).
> I send EM_SETTEXTEX the window's text.
> I use SetWindowPos to position, size, and activate the window.
> I send EM_EXSETSEL to unselect all the characters.
> I call HideCaret.
>
> This all happens in response to a mouse click in another window.  (I am
> trying to provide popup information in response to the click.)
>
> David Liebtag



Hi,

That's why the function is not working out for you because
you are not handling the required notification message.

You need to process the following message and then call
the function to hide the system caret:

	case EN_SETFOCUS:
			HideCaret(hwndCtl);
			Break;

http://msdn.microsoft.com/en-us/library/bb761685(VS.85).aspx

Kellie.
date: Tue, 15 Jul 2008 11:19:45 -0700 (PDT)   author:   Kellie Fitton

Re: Hiding a rich edit caret   
I tried handling the EN_SETFOCUS in the parent's procedure and although I do 
get the notification, calling HideCaret() still has no effect.

David Liebtag
date: Tue, 15 Jul 2008 14:38:14 -0400   author:   David Liebtag

Re: Hiding a rich edit caret   
I mean what is the program doing when HideCaret is called. If HideCaret is 
called when the window is created then that is not likely to work.

I am not sure how carets work but I am nearly certain that you need to hide 
the caret each time the mouse enters the window. I think windows do not 
retain the visibility status of carets.

So if it were me, I would search for samples of using HideCaret. The Windows 
SDK has many sample programs; search for HideCaret in them.


"David Liebtag"  wrote in message 
news:Oo45CCq5IHA.5052@TK2MSFTNGP03.phx.gbl...
>
> I'm not sure what you mean when you ask where I am using HideCaret.
date: Sat, 19 Jul 2008 07:56:04 -0700   author:   Sam Hobbs _change_social_to_socal

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us