3

I am trying to retrieve texts from the clipboard using Python module called win32clipboard, as it is described here. But Windows 7 does not allow to access the clipboard with the error 1418 - ERROR_CLIPBOARD_NOT_OPEN as I use:

data = win32clipboard.GetClipboardData()

How can I defeat the system and get the data?

Community
  • 1
  • 1
  • Did you open clipboard first? Use `OpenClipboard()` – Igor Jerosimić Mar 30 '13 at 17:24
  • Yes, with 'win32clipboard.OpenClipboard()' – Philip Minlos Mar 30 '13 at 17:30
  • What do you receive from 'OpenClipboard' function? If zero then call `GetLastError` and see what happened. – Igor Jerosimić Mar 30 '13 at 17:47
  • `Traceback (most recent call last): File "", line 1, in data = win32clipboard.GetClipboardData() pywintypes.error: (1418, 'GetClipboardData', 'Буфер обмена для потока команд не открыт.')`; 'Буфер обмена для потока команд не открыт.' is "Clipboard is not open for instruction stream" in Russian – Philip Minlos Mar 30 '13 at 18:05
  • run it as administrator. – 0x90 Mar 30 '13 at 18:12
  • As a matter of fact, the account I use is the administrator account. I am trying to run the code in the standart IDLE, just to see what will happen. – Philip Minlos Mar 30 '13 at 18:18

1 Answers1

1

Make sure you have not opened the clipboard twice. You must close it then reopen it.

The open-close operations can't be nested.

thinker3
  • 12,771
  • 5
  • 30
  • 36