IT Community - Software Programming, Web Development and Technical Support

What is the syntax for TextOut function in VC++ Win32 application?

This is a discussion on What is the syntax for TextOut function in VC++ Win32 application? within the C and C++ Programming forums, part of the Software Development category; What is the syntax for TextOut function in VC++ Win32 application?...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Software Development > C and C++ Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-30-2007, 12:36 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question What is the syntax for TextOut function in VC++ Win32 application?

What is the syntax for TextOut function in VC++ Win32 application?

Last edited by mobilegeek : 08-11-2007 at 12:01 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-30-2007, 12:40 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Talking Re: What is the syntax for TextOut function in VC++ Win32 application?

The TextOut function writes a character string at the specified location, using the currently selected font, background color, and text color.

BOOL TextOut(
HDC hdc, // handle to device context
int x, // x-coordinate of starting position
int y, // y-coordinate of starting position
LPCTSTR lpString, // pointer to string
int cbString // number of characters in string
);

The first argument is the handle to the device context either the hdc value returned from GetDC or from BeginPaint during the processing of a WM_PAINT message. The second and third arguments x and y defines the starting point of the character string within the client area. The fourth argument lpsring is a pointer to character string and the last argument cbString indicates the number of characters in the string.

Eg: TextOut (hdc,x,y,”LeftButtonPressed”,17);

Last edited by kingmaker : 08-11-2007 at 12:08 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 08-09-2007, 01:14 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question Re: What is the syntax for TextOut function in VC++ Win32 application?

Is there any sample?

Thanks...

Last edited by mobilegeek : 08-11-2007 at 12:02 AM.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 08-09-2007, 03:23 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Default Re: What is the syntax for TextOut function in VC++ Win32 application?

Hi..Geek,

Here is the sample…..

BOOL TextOut(HDC hdc,int nXStart,int nYStart,LPCTSTR lpString,int cbString);

Then put the following code in WndProc,

case WM_PAINT:
hdc = BeginPaint(hDlg, &ps);
TextOut(hdc, 0, 0, "Hello, Windows!", 15);
EndPaint(hDlg, &ps);
break;


That’s it…
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How is JavaScript syntax like C / C++? itbarota HTML, CSS and Javascript Coding Techniques 1 09-13-2007 04:09 AM
How can communicate between child and parent windows in VC++ win32 application? kingmaker C and C++ Programming 1 07-30-2007 12:51 AM
What is ShowWindow() in VC++ Win32 application? Why we use ShowWindow()? mobilegeek C and C++ Programming 1 07-30-2007 12:39 AM
How can we get the text from edit control in Win32 VC++ application? mobilegeek C and C++ Programming 1 07-25-2007 11:27 PM
I am using CString in my win32 application... theone C and C++ Programming 0 07-17-2007 03:41 AM


All times are GMT -7. The time now is 09:50 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0