MS Windows Clipboard

Mark Hammond MarkH at ActiveState.com
Wed Oct 25 20:01:16 EDT 2000


"Alex Martelli" <aleaxit at yahoo.com> wrote in message
news:8t6fmn0bg9 at news1.newsguy.com...
> "Mark Hammond" <MarkH at ActiveState.com> wrote in message

> > > Calling win32clipboard.GetClipboardData(1) is clearly the
> > > way to get at the data we want.  It's documented as
> > > returning "the handle of a clipboard object in the specified
> > > format", so we might worry about using a PyHANDLE to
> >
> > Fixed the docs ;-)
>
> A third Very Good Thing.  Although getting the handle might
> not be a bad idea either (e.g, for a DragQueryFile I'd like
> the bare HDROP...).

Maybe it would make sense to add a new optional param, indicating the
type of the result.  You could ask the the "default" (current
behaviour), or explicitly for one of either string, unicode, or
integer handle.  I'm not sure we expose enough functions to make the
handle useful, but it does provide room for growth.

unicode would _not_ provide an encoding option - it would assume
standard Windows UCS2.  If you want to assume an encoded Unicode
string, you would ask for a string object, and make the conversion
yourself.

What would this param look like - maybe a simple string "string",
"unicode", "handle", with None or "" == default?

> and please feel free
> to use the text in that post, or an edited version of it, in
> any way you like (as an example of how to approach a Windows
> programming task with Python and win32all, for example:-).

Well, please feel free to submit to me a little, simple HTML file with
any content you like.  Ensure you are attributed as author.  I will
then ensure that it gets in the win32all and ActivePython
documentation sets.  John Nielsen has contributed a large amount of
documentation that way...

Thanks,

Mark.






More information about the Python-list mailing list