Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How do I backup and restore clipboard?

8 views
Skip to first unread message

chenjian

unread,
Dec 10, 2009, 11:33:01 PM12/10/09
to
Hello, could you help me for clipboard?

Reference:

//Backup Clipboard to object
System.Windows.Forms.DataObject oldData =
(DataObject)System.Windows.Forms.Clipboard.GetDataObject();

//Clear Clipboard
System.Windows.Forms.Clipboard.Clear();
//Do other things...


//Restore from backup object
Clipboard.SetDataObject(oldData, true);//Exception

Question ( 1 or 2 ):
1、Exception :System.Runtime.InteropServices.ExternalException
ErrorCode: -2147221040

2、Data Error ( Sometimes result is true, but sometimes it is false ),
Example:
Clipboard: ABC---->Backup

//Operation ( more than once ) : use Ctrl+C and Ctrl+C in other application
//Ctrl + C: 123,Ctrl + V:123

Clipboard: 123<----Restore


Please help me, than you.

jerry qian

unread,
Jan 3, 2010, 9:17:24 PM1/3/10
to
报个到

(MS News) Gophern Kwok

unread,
Jan 28, 2010, 8:53:54 PM1/28/10
to
jerry qian wrote:
> 报个到
MS系列不如Java开放,可怜的Java虽然被收购,还是远比这里热闹。
0 new messages