[python-win32] Problem accessing GetFontData in Windows API

Preston Landers planders at gmail.com
Fri Jan 22 23:40:32 CET 2010


> I'm trying to access the following function from the Windows API:
> 
> http://msdn.microsoft.com/en-us/library/dd144885(VS.85).aspx
> 
> I'm sure I'm drastically over simplifying, but I'm testing it like this:
> 
> import win32api
> print win32api.GetFontData()
> 
> This of course errors out with "AttributeError: function 'GetFontData' not found".

I'm not 100% sure but I think you're going to need to use ctypes to call that. 

It's a little complicated but this may help:

http://python.net/crew/theller/ctypes/tutorial.html

>>> from ctypes import *
>>> windll.gdi32
<WinDLL 'gdi32', handle fe340000 at 27b4cc0>
>>> windll.gdi32.GetFontData
<_FuncPtr object at 0x000000000273B2B8>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100122/f1a3b8a5/attachment.htm>


More information about the python-win32 mailing list