Home > Net >  OpenClipboard failure?
OpenClipboard failure?

Time:10-03

OpenClipboard failure (exception from HRESULT: 0 x800401d0 (CLIPBRD E CANT OPEN))

I wrote a program automatically send text, logic is simple: the sending of text into the clipboard, and then send out,

I am put clipboard operation in the DLL, generally no problem, also don't know which programs and conflict, or what's the matter, sometimes will throw this exception.
I checked on the net a circle, as if the shear plate with the handle to the window and relationship? !

I put this code rewritten in the main program, will be ok? Feel puzzling...

 
Private void Fun2 (string pString)
{
//LkfClipboard saveClip ();
//Clipboard. SetDataObject (pString, true);
//Utils. DelayMilliseconds (100);
Clipboard. SetText (pString);
Thread.sleep (1000);
//Utils. DelayMilliseconds (100);
//string strData=(https://bbs.csdn.net/topics/GetTxtClipboard);
LKFcombinatorialKeyDownUp (new FunctionalKeysName [1] {FunctionalKeysName. Leftcontrol}, new KeyboadName [1] {KeyboadName. V});
Utils. DelayMilliseconds (200);
The Clipboard. The Clear ();
//LkfClipboard restoreClip ();

}

CodePudding user response:

If your code in the loop frequently accessed clipboard?
Can try to reduce the frequency or exception handling, and then ignore this mistake

CodePudding user response:

reference 1st floor stherix response:
is frequently accessed in your code in cyclic shear plate?
Can try to reduce the frequency or exception handling, and then ignore this error

I start like a thunderbolt, appears the mistake...

CodePudding user response:

Myself with a scrapbook ten times there will be a strange mistakes, but ignore it and well,
This is no solution of the BUG

CodePudding user response:

refer to the second floor lkf181 response:
Quote: refer to 1st floor stherix response:

If your code in the loop frequently accessed clipboard?
Can try to reduce the frequency or exception handling, and then ignore this error

I start like a thunderbolt, appears the mistake...


Thunderbolt is constantly monitoring the clipboard, because he wanted to capture the download address
So may be in conflict
  •  Tags:  
  • C#
  • Related