MS Windows Clipboard

Alex Martelli aleaxit at yahoo.com
Thu Oct 26 15:36:09 EDT 2000


"Mark Hammond" <MarkH at ActiveState.com> wrote in message
news:gvKJ5.15107$Ab3.80813 at news-server.bigpond.net.au...
    [snip]
> > > > 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
    [snip]
> > 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.

What an excellent idea!


> 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.

Makes sense.  Non-UCS2 Unicode would only come from custom
datasources anyway.


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

Or maybe type(""), type(u""), type(PyHandle)...?


Alex






More information about the Python-list mailing list