Solved

The trademark symbol in a string

Posted on 2006-11-11
2
512 Views
Last Modified: 2013-11-20
Hi,

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?

Thanks
0
Comment
Question by:DJ_AM_Juicebox
2 Comments
 
LVL 22

Expert Comment

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

http://msdn.microsoft.com/library/en-us/gdi/fontext_0odw.asp?frame=true
http://msdn.microsoft.com/library/en-us/gdi/fontext_5yd0.asp?frame=true

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.....
http://msdn2.microsoft.com/en-us/library/z7e878zz.aspx

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

-MAHESH
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 17921813
™ is available in all Windows fonts (well, maybe not in Wingdings), so just make that

    CString str;
    str.Format("MyFantasticApp™");

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

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Doc'in system (example?) BA 7 89
zeroMAx challenge 20 88
fix34  challenge 9 105
Problem to open Excel file 15 99
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now