Solved

How to display text on windows applications?

Posted on 2009-04-02
5
242 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 50 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 50 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 150 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

737 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