Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

Using the Clipboard, Part I : Transferring Simple Text

, 6 May 2002
In this first article of a four-part series on learning everything you ever wanted to know about programming the Windows Clipboard, you'll discover the basic steps of using the Clipboard API to transfer simple (ANSI) text to and from the Clipboard.
// SimpleTextTransferDlg.h : header file
//

#pragma once
#include "afxwin.h"


// CSimpleTextTransferDlg dialog
class CSimpleTextTransferDlg : public CDialog
{
// Construction
public:
	CSimpleTextTransferDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_SIMPLETEXTTRANSFER_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	afx_msg void OnBnClickedBtncopy();
	afx_msg void OnBnClickedBtncut();
	afx_msg void OnBnClickedBtnpaste();
  CEdit m_edtToClipboard;
  CEdit m_edtFromClipboard;
  afx_msg void OnBnClickedButton1();
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Tom Archer
Software Developer (Senior) Microsoft
United States United States
I'm a Senior Programming Writer in the Microsoft Windows Server organization where my focus is WMI, BITS, WinRM, and SMI-S.

| Advertise | Privacy | Mobile
Web04 | 2.8.141015.1 | Last Updated 7 May 2002
Article Copyright 2002 by Tom Archer
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid