Are the fields in MS-OFORMS in fmPosition swapped?

Daniel Seiler 0 Reputation points

In MS-OFORMS, specifically the fmPosition struct is described as "Top (4 bytes)", then "Left (4 bytes)", i.e. vertical offset, then horizontal offset.

This is inconsistent with real world data I have found, such as the example at (Download In there is a frmCalculator design stream with cmdBtn7, cmdBtn8, cmdBtn9, which are visually on the same row (i.e. same distance to top), but the second value in the stream is identical for all.

It is also inconsistent with fmSize being width, then height, which would be horizontal, then vertical. Is it possible that the specification is mismatched with the product implementation here and should be updated?

Kind regards

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
112 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Tom Jebo 1,741 Reputation points Microsoft Employee

    Hi @Daniel Seiler ,

    It looks like the assumption that "Top" is a vertical or Y axis measurement is incorrect. The fmPosition struct matches the Windows API POINT structure (x then y). For fmPosition, the correct interpretation is "Top" means horizontal and "Left" means vertical, i.e. "Top" means the position along the top (horizontal) edge of the bounding box and "Left" means the position along the left vertical side of the bounding box.

    Does that help to clarify the meaning?

    Best regards,
    Tom Jebo
    Microsoft Open Specifications Support