Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

The trademark symbol in a string

Posted on 2006-11-11
2
521 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CRON statement to run every 3 minutes except on Monday morning 12am to 2am 7 101
notReplace  challenge 53 141
zeroMAx challenge 20 111
Is there a simple front-end menu system. 9 103
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.

856 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