I have a problem to write an MFC application that will display whatever the user types in the client area. Also I need to restore (repaint) everything when user minimize the window.
Right now I am using the code from the book that allows user to enter one char and to restore the same one but I dont know how to that for more lines. New line should start when user press enter.
this is what i'm using so far (copy/paste from the book)Code:// Process a WM_CHAR message. afx_msg void CMainWin::OnChar(UINT ch, UINT count, UINT flags) { CClientDC dc(this); dc.TextOut(1, 1, " ", 3); // erase previous char wsprintf(str, "%c", ch); dc.TextOut(1, 1, str, strlen(str)); } // Process a WM_PAINT message. afx_msg void CMainWin::OnPaint() { // If we use CClientDC instead we will have a LOT of paint messages. CPaintDC dc(this); // this line redisplays the last character dc.TextOut(1, 1, str, strlen(str)); }
everything will help
Thanks



LinkBack URL
About LinkBacks


