Click here to Skip to main content
Click here to Skip to main content

Clipboard backup (Visual C++)

By , 20 Sep 2005
Rate this:
Please Sign up or sign in to vote.

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)

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 

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
Web03 | 2.8.140415.2 | Last Updated 20 Sep 2005
Article Copyright 2005 by sswater shi
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid