Skip to main content
gamedev.net
🔒 Locked

Stupid question

Started by caffeineaddict Nov 23, 2000 at 11:13 PM 2 replies 300+ views
Original Post
caffeineaddict
caffeineaddict
Well this question will be stupid to most of you but i am a newbie and cant find the answer anywhwere at all. I would like to know how to output text in a windows program using C++, i cant find out how to anywhere, help would be appreciated
Quantum
Quantum
If you have your main window set up you can use TextOut() like so:

HDC hDC;
hDC = GetDC(hWnd); //hWnd is the handle to your main window

TextOut(hDC, XPos, YPos, "Text", strlen("Test")); //Self-explanatory, 4th parameter is the length of the string

ReleaseDC(hWnd, hDC);
Zeke
Zeke
You can also use DrawText() in a similar fashion to TextOut(). But TextOu() is the easier/quicker way cos DrawText has more paramaters and stuff.

"People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
Just my thoughts take them as you will. "People spend too much time thinking about the past, whatever else it is, its gone"-Mel Gibson, Man Without A Face
Prosper/LOADED
Prosper/LOADED
Oh! Holy s**t! The previous guys answered quicker than me!

quote:
Original post by caffeineaddict

Well this question will be stupid to most of you but i am a newbie and cant find the answer anywhwere at all.



By the way, it''s not stupid at all. Even "gurus" started as newbies and i often worked a lot to find "stupid answers".

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.