Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2008 May : "Cannot open clipboard"

www.cryer.info
Managed Newsgroup Archive

"Cannot open clipboard"

Subject:"Cannot open clipboard"
Posted by:"Mike Scott" (mi..@lexically.net)
Date:Wed, 07 May 2008 15:05:06 +0100

(Win XP SP2, Delphi 2007)

I'm getting this exception when I have a Notepad text file open, press
Ctrl/C and then in another application I've created try to paste from a
mask-edit.

if not OpenClipboard(FClipboardWindow) then
raise Exception.CreateRes(@SCannotOpenClipboard);

The call to the Clipboard comes in the Mask unit, WMPaste procedure:
...
Clipboard.Open;
Value := Clipboard.AsText;
Clipboard.Close;
...

The fault seems not to happen if I first close the Notepad text file.
Could it be that Notepad is badly behaved?

Mike
    

Info

Glossary

Replies:

www.cryer.info
Managed Newsgroup Archive