?
Solved

How to display text on windows applications?

Posted on 2009-04-02
5
Medium Priority
?
246 Views
Last Modified: 2013-11-17
Is it possible to create a software to display text on windows applications such as games?
If so, can you please provide me the documentation I should study?
0
Comment
Question by:Chrysaor
[X]
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
5 Comments
 
LVL 53

Assisted Solution

by:Infinity08
Infinity08 earned 200 total points
ID: 24048501
Yes, that's definitely possible. How to do that, depends on what kind of application you're talking about, and which graphics libraries you use for output.

What kind of game is this ? Which graphics libraries do you use ? Or is this a standard GUI game using the Windows API or another more specific framework ? Or ...
0
 
LVL 16

Assisted Solution

by:George Tokas
George Tokas earned 200 total points
ID: 24052320
Addition:
And the compiler used. If it is C++ Builder there are components for that job...

George Tokas.
0
 
LVL 86

Accepted Solution

by:
jkr earned 600 total points
ID: 24052323
The API in question is 'DrawText()' (http://msdn.microsoft.com/en-us/library/dd162498(VS.85).aspx). For an example, see http://msdn.microsoft.com/en-us/library/ms646268(VS.85).aspx ("Using Keyboard Input" - the text entered is the text that's displayed), the scoop would be to
        case WM_PAINT: 
            if (cch == 0)       // nothing in input buffer 
                break; 
 
            hdc = BeginPaint(hwndMain, &ps); 
            HideCaret(hwndMain); 
 
            // Set the clipping rectangle, and then draw the text 
            // into it. 
 
            SetRect(&rc, 0, 0, dwLineLen, dwClientY); 
            DrawText(hdc, pchInputBuf, -1, &rc, DT_LEFT); 
 
            ShowCaret(hwndMain); 
            EndPaint(hwndMain, &ps); 
            break; 

Open in new window

0
 

Author Comment

by:Chrysaor
ID: 24066637
Infinity08: A simple windows application, such as the windows games or Paint.
George Tokas: Can you please tell me some of these components?
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 24075181
>> Infinity08: A simple windows application, such as the windows games or Paint.

Didn't the DrawText function jkr suggested work for you ?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses
Course of the Month11 days, 13 hours left to enroll

752 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