⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 recordadddlg.cpp

📁 金山词霸界面的数据库管
💻 CPP
字号:
// RecordAddDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Abc.h"
#include "RecordAddDlg.h"

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

/////////////////////////////////////////////////////////////////////////////
// CRecordAddDlg dialog


CRecordAddDlg::CRecordAddDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CRecordAddDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(CRecordAddDlg)
	m_strEnglish = _T("");
	m_strChinese = _T("");
	//}}AFX_DATA_INIT
}


void CRecordAddDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRecordAddDlg)
	DDX_Text(pDX, IDC_EDIT1, m_strEnglish);
	DDX_Text(pDX, IDC_EDIT2, m_strChinese);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(CRecordAddDlg, CDialog)
	//{{AFX_MSG_MAP(CRecordAddDlg)
	ON_BN_CLICKED(IDC_SELF_PASTE, OnSelfPaste)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRecordAddDlg message handlers


void CRecordAddDlg::OnSelfPaste() 
{
	// TODO: Add your control notification handler code here
	if(!IsClipboardFormatAvailable(CF_TEXT))
	{
		AfxMessageBox(IDS_ERROR_FORMAT,MB_OK|MB_ICONEXCLAMATION);
		return;
	}
	HGLOBAL hglb;
	CString strText;;
	OpenClipboard();
	hglb = GetClipboardData(CF_TEXT); 
	if (hglb != NULL) 
    {
		CString strText =(LPTSTR)GlobalLock(hglb); 
        if (!strText.IsEmpty()) 
        { 
                strText.TrimLeft();
				strText.TrimRight();
				int n=strText.Find('\n');
				int m=strText.Find(' ');
				int i=-1;
				if(n>=0)
					i=n;
				else if(m>=0)
					i=m;
				else
					;

				if(i>=0)
				{
					m_strEnglish=strText.Left(i);
					m_strEnglish.TrimRight();
					m_strChinese=strText.Right(strText.GetLength()-i-1);
					m_strChinese.TrimLeft();
					UpdateData(FALSE);

				}
				else
				{
					m_strEnglish=strText;
					m_strChinese.Empty();
					UpdateData(FALSE);
				}

			    GlobalUnlock(hglb); 
        }
	}
       
   CloseClipboard(); 


	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -