Solved

The trademark symbol in a string

Posted on 2006-11-11
2
508 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
Comment Utility
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
Comment Utility
™ 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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. …
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

762 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

7 Experts available now in Live!

Get 1:1 Help Now