1. RE: Link in an edit control

> All,
> 
> I'm wanting to imbed a link in a rich edit control (like a hyper-link in 
> 
> a browser window).  
> 
> I found the documentation at MSDN for using the message EM_SETCHARFORMAT 
> 
> with the CHARFORMAT2 structure.  Subfield dwEffects allows you to 
> specify CFE_LINK style.  When the user clicks or the mouse hovers over 
> text with this style a WM_NOTIFY message is sent (EN_LINK) to the parent 
> 
> control.
> 
> I tried to work up an example but couldn't.  Also didn't find any good 
> examples on the net (yet).
> 
> Anyone ever try this and might have an example?
> 
> CHARFORMAT2 would also be a good addition to Win32Lib as it adds a few 
> other "effects" that might be nice to use.
> 
> Jonas

Heyas Jonas...

While I dont have an example worked up (never needed this before), was 
just curious as to what the problem was...

Does the control not underline the link at all or are you not getting 
notifications to your parent?

If its not underlining the text I would look at the call to the RichEdit 
control with the CHARFORMAT2 structure as the culprit.

If this (seems) ok but you are not being notified, make sure you set up 
the event mask first :)
(ie To receive EN_LINK notifications, specify the ENM_LINK flag in the 
mask sent with the EM_SETEVENTMASK message)

Don

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu