Guest_imported
New member
- Jan 1, 1970
- 0
I'm just learning C++ and would like to know How ,in a window ,in which, i have successfully input keystrokes, can i make a carriage return. Here some of my code
/////////////////////////////////////////////////////////////////////////////
// CKeystrokesView message handlers
void CKeystrokesView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CKeystrokesDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->StringData += nChar;
Invalidate();
if (CKeystrokesDoc->StringData ='\r')
{
CRect rect;
GetWindowRect(&rect);
int y = rect.Height() - 1;
}
CView::OnChar(nChar, nRepCnt, nFlags);
}
/////////////////////////////////////////////////////////////////////////////
// CKeystrokesView message handlers
void CKeystrokesView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CKeystrokesDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->StringData += nChar;
Invalidate();
if (CKeystrokesDoc->StringData ='\r')
{
CRect rect;
GetWindowRect(&rect);
int y = rect.Height() - 1;
}
CView::OnChar(nChar, nRepCnt, nFlags);
}