hi what i want to know is ,how to display the text in window using TextOut.what i want is when i execute the for loop the textout should print or display the text on next ,next line. i.e one string on one line,next string on next line. can any body tell me how to do this.it is very urgent. regards vidhya
ya.what i want to do is when i execute a for loop in that loop i am printing some text on window using textout.at first time when for loop runs textout print text on window on one line.next time when it execute the textout should print the text in second line on same window.how to do this. regards vidhya
Have some static variable to store the line previously print and do the TextOut ( yStart ) accordingly depending on the variable value.
Hey Vidya.... Here is the sample for TextOut.... Syntax for TextOut(): 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…
A more appropriate example will be. Code: case WM_PAINT: { hdc = BeginPaint(hWnd, &ps); wchar_t* msg[3] = { L"vidhya", L"satindar",L"vinoth", }; for( int i=0;i < 3; i++ ){ TextOut(hdc, 0, 20*i, msg[i], lstrlen( msg[i] ) ); } EndPaint(hWnd, &ps); } break;