home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.funduc.com
/
2014.08.ftp.funduc.com.tar
/
ftp.funduc.com
/
fshedcode-072212.zip
/
PasteSpecialDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2010-09-13
|
3KB
|
93 lines
/////////////////////////////////////////////////////////////////////////////
// License (GPLv2+):
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
/////////////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "fshed.h"
#include "PasteSpecialDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CPasteSpecialDlg dialog
CPasteSpecialDlg::CPasteSpecialDlg(CWnd* pParent /*=NULL*/)
: CDialog(CPasteSpecialDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CPasteSpecialDlg)
m_strClipText = _T("");
m_nNumTimes = 1;
m_nInsertMode = 1;
m_nSkipBytes = 0;
m_bPasteAsText = TRUE;
//}}AFX_DATA_INIT
}
void CPasteSpecialDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPasteSpecialDlg)
DDX_Text(pDX, IDC_CLIP_TEXT_ED, m_strClipText);
DDX_Text(pDX, IDC_NUM_TIMES_ED, m_nNumTimes);
DDV_MinMaxInt(pDX, m_nNumTimes, 1, 1000000);
DDX_Radio(pDX, IDC_OVERWRITE_RB, m_nInsertMode);
DDX_Text(pDX, IDC_SKIP_BYTES_ED, m_nSkipBytes);
DDV_MinMaxInt(pDX, m_nSkipBytes, 0, 1000000);
DDX_Check(pDX, IDC_AS_TEXT_CHK, m_bPasteAsText);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPasteSpecialDlg, CDialog)
//{{AFX_MSG_MAP(CPasteSpecialDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPasteSpecialDlg message handlers
BOOL CPasteSpecialDlg::OnInitDialog()
{
if (OpenClipboard())
{
HGLOBAL hClipMemory = GetClipboardData (CF_UNICODETEXT);
if (hClipMemory != NULL)
{
int gsize = (int)GlobalSize(hClipMemory);
if (gsize > 0)
{
TCHAR* pClipMemory = (TCHAR*) GlobalLock (hClipMemory);
memcpy (m_strClipText.GetBuffer(gsize), pClipMemory, gsize * sizeof(TCHAR));
m_strClipText.ReleaseBuffer(gsize);
}
GlobalUnlock (hClipMemory);
}
CloseClipboard ();
}
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}