在一个SDI应用程序中获取窗口客户区指针,从而利用SetWindowText在客户区显示一段文字?

解决方案 »

  1.   

    用CWnd::GetD得到客户去的设备描述表,然后用TextOut.
      

  2.   

    CDC *mDC=this->GetDC();
    mDC->TextOut(10,10,"ffff"):
      

  3.   

    在ondraw函数中
    pDC->TextOut(10,10,"ffff");
      

  4.   

    CDC dc(this);
    dc.TextOut(10,10,"here is test");
      

  5.   

    CRect rectclient;
    GetClientRect(&rectclient);     
    CSize sizeclient=rectclient.Size();
    CString str=pDoc->m_str;
    CSize sizeTextExtent= pDC->GetTextExtent(str);
    pDC->TextOut( 10,10,str);
      

  6.   

    在ondraw函数中
    pDC->TextOut(10,10,str);
      

  7.   

    CWnd* pWnd;
    pWnd=GetDlgItem(IDC_EDIT);
    pWnd->SetWindowsText("text out here");