k, the problem is like this:

I develop an MFC application that displays text in small windows that float around the screen. This works fine.
I don't want to use edit controls or rich edit controls for a few reasons.

I now want to parse the text for URLS and make them hyperlinks. Coloring works fine, I just keep track of URL or not while painting.

I also have a function that calculates the size of the output. It basically does the same as the paint function without really painting anything or keeping track of URL or not.

Now the question is, how do I design my code to calculate the POSITION of the link - that is the area where the user can click to get sent there? I could either just store this while painting. Wouldn't be much more code, but gets called more often than necessary.
Or I could add code to calculate that in the function that calculates the size. Would only called when needed, but would require quite a lot more code.

Which do you recommend?

Thx in advance.