The mezuzah should be affixed to the top third of the doorpost, measuring from the lower lintel.[1] The extended posts are excluded because the window does not become an entrance merely because it is framed by posts and a lintel. Moreover, the significant posts are the ones that frame the door.[2]
Even so, if there is an area where the top thirds of both calculations intersect, the mezuzah should ideally be placed there, as long as it would still be a tefach away from the lower lintel.[3]
[1] Mezuzot Beitecha 289:2, citing oral ruling of Chazon Ish.
[2] Indeed, according to Rambam, a doorway without a door is exempt from mezuzah.
[3] Teshuvos V’Hanhagos 2:550.