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?...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| 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. |
| |||
| 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! |
![]() |
| Thread Tools | |
| Display Modes | |
| |
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 |