There is an api GetTextExtentPoint32:

http://www.allapi.net/apilist/apifun...tExtentPoint32

It works against any object that has a device context. SIZE is a POINTAPI structure. Follow the link at the page bottom for sample source code.