[python-win32] How to copy an image using win32clipboard

2020-12-01 Thread Steven Manross
Based on reading 
http://timgolden.me.uk/pywin32-docs/win32clipboard__GetClipboardData_meth.html 
I would suggest that getting image data from the clipboard isn't implemented 
yet, but I do not know that for sure as I don't know when that document was 
updated.

However, this python code seems to get text data just fine.

import win32clipboard


win32clipboard.OpenClipboard()
var = win32clipboard.GetClipboardData()
win32clipboard.CloseClipboard()

print(var)

I would also point out that it seems that the "CloseClipboard" is incredibly 
important as it seems that python takes an exclusive lock on the clipboard 
while the Clipboard is Opened.

HTH

Steven
---
Date: Tue, 1 Dec 2020 11:00:52 +
From: Pranav Gadre 
To: "python-win32@python.org" 
Subject: [python-win32] How to copy an image using win32clipboard
Message-ID:



Content-Type: text/plain; charset="windows-1252"

Hello,

When we take a snip on windows OS, it automatically goes to clipboard. I want 
to access any copied image using win32clipboard. How do I do that?
Please check this for more reference: Closed 
issue<https://github.com/mhammond/pywin32/issues/1627>
Thank you and pardon me for any missing things as I?m new to this mailing list.
Regards,
Pranav



___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] How to copy an image using win32clipboard

2020-12-01 Thread Stimpy ******
Hi Pranav,

Just resending this to the list. 
Here's a great resource: http://timgolden.me.uk/pywin32-docs/win32clipboard.html

The document covers the win32clipboard module very well.The API you'll want to 
reference is the Win32 API. If you need to reference the protocol/steps in an 
even more verbose way, WinUser.h's MSDN pages' remarks section will fill any of 
those gaps.

One such pearl is a warning about about clipboard data:  "Clipboard data is not 
trusted. Parse the data 
carefully before using it in your application."

Tim's page does a good job with pointing you in the direction of getting more 
info about any of the given API functions. For example:

https://docs.microsoft.com/en-us/windows/win32/dataxchg/clipboard
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getclipboarddata
https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumclipboardformats

Kind Regards,
Adam B. Dodson



From: python-win32  on 
behalf of Pranav Gadre 
Sent: Tuesday, December 1, 2020 6:00 AM
To: python-win32@python.org 
Subject: [python-win32] How to copy an image using win32clipboard 
 
Hello,
 
When we take a snip on windows OS, it automatically goes to clipboard. I want 
to access any copied image using win32clipboard. How do I do that?
Please check this for more reference: Closed issue
Thank you and pardon me for any missing things as I’m new to this mailing list.
Regards,
Pranav
 
Sent from Mail for Windows 10
 
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] How to copy an image using win32clipboard

2020-12-01 Thread Pranav Gadre
Hello,

When we take a snip on windows OS, it automatically goes to clipboard. I want 
to access any copied image using win32clipboard. How do I do that?
Please check this for more reference: Closed 
issue
Thank you and pardon me for any missing things as I’m new to this mailing list.
Regards,
Pranav

Sent from Mail for Windows 10

___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32