[python-win32] Re: WIN32 API?

Chuck Esterbrook ChuckEsterbrook at yahoo.com
Wed Jun 4 19:45:59 EDT 2003


On Tuesday 03 June 2003 12:51 am, Thomas Heller wrote:
> There's a win32gui.PumpWaitingMessages() which contains the complete
> message loop.

Thanks for the numerous tips! I'm still interested in getting what I 
would call "full access". Here's what I've been doing/thinking:

I was looking at win32all because it seems to already "know" what the 
proper return types and arg types are for functions. However, the 
disadvantage is that several functions (and possibly structs) are not 
available. While I understand that win32 is somehwhat of a moving 
target, many funcs such as beginpaint, drawtext and endpaint are not.

ctypes can call just about anything which is fantastic. But it doesn't 
"know" the structs or the function types.

I then briefly contemplated writing a C preprocessor and C parser that 
would suck up *.H out of the VC98 directory and spew the Python 
"declarations" for ctypes. After all, the information is all right 
there in *.H.

BUT that made me think of SWIG which already does this and is already 
used by win32!

So...I'm a little bit in the dark here. If SWIG's C preprocessor can 
slurp up a header and spew out a library with the structs and 
functions, BUT win32all only has a subset, I feel I must be missing 
something...

Is SWIG really not capable of this? If so, is the newer SWIG 1.3 
capable? (AFAICT win32all uses a modified SWIG 1.1)

If I were to preprocess and parse the C headers, would anything prevent 
me from generating Python source for ctypes to specify the return 
types, arg types and structs?

Any insights are appreciated...

-- 
Chuck
http://ChuckEsterbrook.com




More information about the Python-win32 mailing list