• 大小: 54KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-10
  • 语言: C/C++
  • 标签: C++源码  

资源简介

网络调试工具VS2008 C++源码,花了5分下的

资源截图

代码片段和文件信息

// DalsuRichEdit.cpp : implementation file
//

#include “stdafx.h“
//#include “ExRichEdit.h“
#include “DalsuRichEdit.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

#define ID_RICH_UNDO                    101
#define ID_RICH_CUT                     102
#define ID_RICH_COPY                    103
#define ID_RICH_PASTE                   104
#define ID_RICH_CLEAR                   105
#define ID_RICH_SELECTALL               106
#define ID_RICH_SETFONT                 107
/////////////////////////////////////////////////////////////////////////////
// CDalsuRichEdit

CDalsuRichEdit::CDalsuRichEdit()
{
}

CDalsuRichEdit::~CDalsuRichEdit()
{
}


BEGIN_MESSAGE_MAP(CDalsuRichEdit CRichEditCtrl)
//{{AFX_MSG_MAP(CDalsuRichEdit)
ON_WM_CREATE()
ON_WM_RBUTTONDOWN()
ON_COMMAND(ID_RICH_COPY oncopy)
ON_COMMAND(ID_RICH_CUT oncut)
ON_COMMAND(ID_RICH_PASTE onpaste)
ON_COMMAND(ID_RICH_SELECTALL onselectall)
ON_COMMAND(ID_RICH_UNDO OnUndo)
ON_COMMAND(ID_RICH_CLEAR OnClear)
ON_COMMAND(ID_RICH_SETFONT onselectfont)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CDalsuRichEdit message handlers
int CDalsuRichEdit::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
if (CRichEditCtrl::OnCreate(lpCreateStruct) == -1)
return -1;

// TODO: Add your specialized creation code here
CHARFORMAT cf;

cf.cbSize = sizeof (CHARFORMAT);  
cf.dwMask = CFM_FACE | CFM_SIZE; 
//cf.dwEffects; 
cf.yHeight = 180; 
//cf.yOffset; 
//cf.crTextColor=RGB(25000); 
//cf.bCharSet; 
//cf.bPitchAndFamily; 
sprintf(cf.szFaceName “MS Sans Serif“); 
 
SetDefaultCharFormat(cf); 
 
return 0;
}


void CDalsuRichEdit::AddText(LPCTSTR szTextIn COLORREF &crNewColor)
{
int iTotalTextLength = GetWindowTextLength();
SetSel(iTotalTextLength iTotalTextLength);
ReplaceSel(szTextIn);
int iStartPos = iTotalTextLength;

CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD;
cf.dwEffects =(unsigned long) ~( CFE_AUTOCOLOR | CFE_UNDERLINE | CFE_BOLD);
cf.crTextColor = crNewColor;
int iEndPos = GetWindowTextLength();
SetSel(iStartPos iEndPos);
SetSelectionCharFormat(cf);
HideSelection(TRUE FALSE);

LineScroll(1);
}

void CDalsuRichEdit::AddText(CString &strTextIn COLORREF &crNewColor)
{
int iTotalTextLength = GetWindowTextLength();
SetSel(iTotalTextLength iTotalTextLength);
ReplaceSel((LPCTSTR)strTextIn);
int iStartPos = iTotalTextLength;

CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD;
cf.dwEffects = (unsigned long)~( CFE_AUTOCOLOR | CFE_UNDERLINE | CFE_BOLD);
cf.crTextColor = crNewColor;//RGB(0 0 0);
// SetSelectionCharFormat(cf);

int iEndPos = GetWindowTextLength();
SetSel(iStartPos iEndPos);
SetSelectionCharFormat(cf);
HideSelection

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        353  2010-10-25 09:39  res\.svn\all-wcprops

     文件        520  2010-11-02 09:29  res\.svn\entries

     文件         53  2010-10-25 09:38  res\.svn\prop-base\taoreg.ico.svn-base

     文件      21630  2010-10-25 09:39  res\.svn\text-base\taoreg.ico.svn-base

     文件        362  2010-10-25 09:39  res\.svn\text-base\taoreg.rc2.svn-base

     文件      21630  2003-07-24 09:52  res\taoreg.ico

     文件        362  2010-10-20 11:36  res\taoreg.rc2

     文件       7372  2007-03-03 20:32  DalsuRichEdit.cpp

     文件       2802  2010-10-20 17:12  DalsuRichEdit.h

     文件       2745  2010-10-20 11:36  ReadMe.txt

     文件       1184  2010-10-20 15:54  resource.h

     文件        137  2010-10-20 11:36  stdafx.cpp

     文件       1856  2010-10-20 11:41  stdafx.h

     文件      43932  2010-11-03 10:32  taoreg.aps

     文件       1736  2010-10-20 11:59  taoreg.cpp

     文件        441  2010-10-20 11:36  taoreg.h

     文件       6355  2010-10-20 18:11  taoreg.rc

     文件       5609  2010-10-20 17:18  taoreg.vcproj

     文件       8635  2010-11-03 10:33  taoregDlg.cpp

     文件       1594  2010-10-20 18:45  taoregDlg.h

     文件       1030  2010-10-20 11:36  targetver.h

     目录          0  2010-10-28 10:19  res\.svn\tmp\prop-base

     目录          0  2010-10-28 10:19  res\.svn\tmp\props

     目录          0  2010-10-28 10:19  res\.svn\tmp\text-base

     目录          0  2010-10-25 09:39  res\.svn\prop-base

     目录          0  2010-10-25 09:39  res\.svn\props

     目录          0  2010-10-25 09:39  res\.svn\text-base

     目录          0  2010-11-02 09:29  res\.svn\tmp

    ...D.H.         0  2010-11-03 10:43  res\.svn

     目录          0  2010-10-25 09:38  res

............此处省略3个文件信息

评论

共有 条评论