home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.funduc.com
/
2014.08.ftp.funduc.com.tar
/
ftp.funduc.com
/
fshedcode102502.zip
/
PasteSpecialDlg.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
2001-11-29
|
2KB
|
79 lines
// PasteSpecialDlg.cpp : implementation file
//
#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_TEXT);
if (hClipMemory != NULL)
{
int gsize = GlobalSize (hClipMemory);
if (gsize > 0)
{
char* pClipMemory = (char*) GlobalLock (hClipMemory);
memcpy (m_strClipText.GetBuffer(gsize), pClipMemory, gsize);
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
}