The trademark symbol in a string


I am supposed to put the little trademark symbol next to some words in my application. Like:

     MyFantasticApp tm

but of course the 'tm' should be much smaller and floating in the top of the margin. How do I format that in a string:

    CString str;
    str.Format("MyFantasticApp%c", tm);

and it also appears as a string resource in some dialog controls etc, how do I modify it in there when vc++ expects a static string?

Who is Participating?
jkrConnect With a Mentor Commented:
™ is available in all Windows fonts (well, maybe not in Wingdings), so just make that

    CString str;

You can type that using ALT+0153 using teh numeric pad or fire up charmap.exe, select and copy it.

You need Graphics text display functions such as DrawText / TextOut with which you can control position of characters at pixel positions.

This functions display text at specified character string at the specified location, using the currently selected font, background color, and text color..

SO for your string you may display MyFantasticApp at 100,100 and then to display 'tm' you may display that after 'MyFantasticApp' with reduced y location like e.g at 100,75

You may use GetTextExtent() to find height and width of string in pixels.....

SO here all you need to control position of characters with above functions and not formatting of string.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.