Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function in app.

Status
Not open for further replies.

greq

Programmer
Oct 31, 2003
1
US


Can someone give me the source code of &quot;Hello&quot;(or whatever) to write in an application? (So not with cout<<)
As you can tell from the qeustion i just started but i really want to see the outcome somewhere else than in a dos screen!!
Thanks in advance,
 
I'll assume you have a basic form or Windows template code to paste the code below into:


HDC hdc ;
RECT rect ;
//hwnd is handle of window where text is displayed

GetClientRect (hwnd, &amp;rect) ;
hdc = GetDC( hwnd );
DrawText (hdc, &quot;Hello, Windows!&quot;, -1, &amp;rect, DT_SINGLELINE | DT_CENTER | DT_VCENTER) ;
ReleaseDC( hwnd , hdc);




Kim_Christensen@telus.net
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top