> For the complete documentation index, see [llms.txt](https://pinvokeisalive.gitbook.io/pinvoke/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pinvokeisalive.gitbook.io/pinvoke/desktopfunctions/gdi32/getcharwidth.md).

# Sample Code:

```cs
[DllImport("gdi32.dll")]
     static extern bool GetCharABCWidths(IntPtr hdc, uint uFirstChar,
    uint uLastChar, ref  ABC lpabc);

     [StructLayout(LayoutKind.Sequential)]
     public struct ABC
     { /* abc */
       public int abcA;
       public uint abcB;
       public int abcC;
      }

      /* Declare an array of 3 struct ABC */
      ABC[] abc = { new ABC(), new ABC(), new ABC() };

      /* put the adress of the first cell of the struct abc array */
      bool ret = GetCharABCWidths(Hdc, 'A', 'C', ref abc[0]);
```
