?
Solved

How to display text on windows applications?

Posted on 2009-04-02
5
Medium Priority
?
251 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
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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.
Suggested Courses

864 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