Click here to Skip to main content
Click here to Skip to main content
Go to top

Clipboard backup (Visual C++)

, 20 Sep 2005
Rate this:
Please Sign up or sign in to vote.
Make a backup copy of clipboard data before your clipboard operation, and when you finish, you can restore clipboard to its original status.

Introduction

This piece of code is to help you backup your clipboard data and restore it after you have finished other clipboard operations.

My experience: while I'm developing Word add-in programs, the icon of the new-added button can only be set through clipboard by "...->PasteFace()". This will empty the clipboard data which is going to be pasted in Word. So, I wrote this class, and it helped me a lot.

Usage:

  // the constructor will do backup clipboard operation
  CClipboardBackup cbbackup;
 
  // any other clipboard operations
  ::OpenClipboard(NULL);
  ::EmptyClipboard();
  ::SetClipboardData(......);
  ::CloseClipboard();
  ....
 
  // restore
  cbbackup.Restore();

Advertisement

By the way, my another article about another topic on another website Smile | :) :

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

sswater shi
Software Developer (Senior)
China China
Begin coding from basic, since 1994. Interested in coding and database and website constructing.
My website: http://www.regexlab.com/ - Regular Expression Laboratory
The easiest regex engine: http://www.regexlab.com/deelx/

Comments and Discussions

 
GeneralMy vote of 1 PinmemberAdminSam18-Jan-12 19:20 
GeneralProblem with CF_BITMAP PinmemberMohammadAmiry28-Mar-07 13:06 
GeneralRe: Problem with CF_BITMAP Pinmembersswater shi28-Mar-07 14:36 
Questionproblem with outlook Pinmembervice12-Feb-07 6:53 
AnswerRe: problem with outlook Pinmembersswater shi13-Feb-07 1:58 
AnswerRe: problem with outlook Pinmembervice13-Feb-07 2:52 
GeneralRe: problem with outlook Pinmembersswater shi13-Feb-07 21:57 
GeneralRe: problem with outlook Pinmemberpengchengwanli4-Dec-09 18:49 
GeneralRe: problem with outlook Pinmemberpengchengwanli4-Dec-09 18:44 
AnswerRe: problem with outlook Pinmemberpengchengwanli4-Dec-09 18:46 
GeneralGreat ! + possible error PinmemberChrisRibe22-Mar-06 8:37 
GeneralRe: Great ! + possible error Pinmembersswater shi22-Mar-06 13:39 
GeneralGOOD Pinmemberpengchengwanli5-Dec-09 20:56 
GeneralIE Access violation for CF_BITMAP Pinmemberjnettleton2-Dec-05 6:56 
GeneralRe: IE Access violation for CF_BITMAP Pinmembersswater shi3-Dec-05 21:00 
GeneralCF_ENHMETAFILE PinmemberFlyZu10-Nov-05 2:23 
AnswerRe: CF_ENHMETAFILE Pinmembersswater shi13-Nov-05 15:57 
GeneralRe: CF_ENHMETAFILE PinmemberFlyZu13-Nov-05 23:00 
QuestionHow to do it in c# Pinmembernagarsoft13-Oct-05 11:49 
AnswerRe: How to do it in c# Pinmembersswater shi13-Oct-05 16:21 
GeneralRe: How to do it in c# Pinmembernagarsoft13-Oct-05 20:01 
GeneralRe: How to do it in c# Pinmembersswater shi13-Oct-05 20:47 
AnswerRe: How to do it in c# Pinmembernagarsoft14-Oct-05 6:19 
GeneralVery useful class - thanks a lot! Pinmembervkurdukov20-Sep-05 1:43 
GeneralRe: Very useful class - thanks a lot! Pinmembersswater shi20-Sep-05 16:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 20 Sep 2005
Article Copyright 2005 by sswater shi
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid