Solved

String with underline

Posted on 1999-01-20
5
259 Views
Last Modified: 2010-04-15
How do i compose a string ( sprintf ) with underlined text ?
0
Comment
Question by:AndersCarlsson
5 Comments
 
LVL 10

Accepted Solution

by:
rbr earned 50 total points
ID: 1258196
This is impossible in plain C. Underlinded text is a special font or character attribute. For which OS do you need this.
0
 

Author Comment

by:AndersCarlsson
ID: 1258197
I need this for a program in a NT system.
0
 
LVL 84

Expert Comment

by:ozo
ID: 1258198
<u>and for what kind of display device?</u>
0
 

Author Comment

by:AndersCarlsson
ID: 1258199
I want it for a string in a MessageBox, in a Windows applikation.
0
 
LVL 11

Expert Comment

by:alexo
ID: 1258200
Message boxes cannot display underlined text.

Create a custom dialog with a static text control, and in the WM_INITDIALOG handler of said dialog create an underlined font and set it as the control's font.

Something like that:

    LOGFONT font = { 0 };
    HFONT   hFont;

    font.lfUnderline = TRUE;
    font.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN;
    hFont = CreateFontIndirect(&font);
    SendDlgItemMessage(hwnd, IDC_TEXT, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

708 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

13 Experts available now in Live!

Get 1:1 Help Now