Extracting Rich Text data formats from win32clipboard

Trader trader at terray.com
Tue Aug 26 13:36:42 EDT 2003


Thanks for your help, Neil!  Your example code gave me an idea what I
should be seeing when the HTML/RTF stuff is working properly.  I'd
been using a non-IE browser (Firebird) for testing, and it wasn't
giving me those results.  Thanks for getting me on track!  Trader

"Neil Hodgson" <nhodgson at bigpond.net.au> wrote in message news:<rlH2b.64505$bo1.45721 at news-server.bigpond.net.au>...
> Trader:
> > >>> clipboard_grab()
> > FORMAT: 49171
> > FORMAT: 16
> > FORMAT: 7
> > FORMAT: 0
> 
> Now add in:
> 
> for f in formats:
>     if f >= 0xC000:
>         print win32clipboard.GetClipboardFormatName(f)
> 
> Formats above 0xC000 are dynamically registered clipboard types. I get:
> 
> FORMAT: 13
> FORMAT: 49278
> FORMAT: 49245
> FORMAT: 49171
> FORMAT: 16
> FORMAT: 7
> FORMAT: 0
> 
> HTML Format
> Rich Text Format
> Ole Private Data
> 
> The HTML has a prologue and then some HTML:
> 
> Version:1.0
> StartHTML:000000195
> EndHTML:000001891
> StartFragment:000001597
> EndFragment:000001710
> StartSelection:000001597
> EndSelection:000001710
> SourceURL:http://sydney.citysearch.com.au/
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
> 
> <HTML><HEAD><TITLE>CitySearch.com.au Australia - Your guide to the city of
> Sydney</TITLE>
> ...
> 
> The RTF looks normal:
> 
> {\rtf1\ansi\ansicpg-1\deff0\deflang3081{\fonttbl{\f0\froman\fcharset0 Times
> New Roman;}{\f1\ftech\fcharset0 Symbol;}{\f2\fswiss\fcharset0
> Arial;}{\f3\fswiss\fcharset0 Courier New;}{\f4\ftech\fcharset0
> Wingdings;}}{\colortbl\red0\green0\blue0;\red0\green0\blue255;\red0\green255
> \blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\r
> ed255\green255\blue0;\red255\green255\blue255;\
> ...
> 
>    Neil




More information about the Python-list mailing list