GetThemeRect function uxtheme

Pointer<RECT> GetThemeRect(
  1. HTHEME hTheme,
  2. int iPartId,
  3. int iStateId,
  4. int iPropId,
)

Retrieves the value of a RECT property.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/uxtheme/nf-uxtheme-getthemerect.

Implementation

Pointer<RECT> GetThemeRect(
  HTHEME hTheme,
  int iPartId,
  int iStateId,
  int iPropId,
) {
  final pRect = adaptiveCalloc<RECT>();
  final hr$ = HRESULT(_GetThemeRect(hTheme, iPartId, iStateId, iPropId, pRect));
  if (hr$.isError) {
    free(pRect);
    throw WindowsException(hr$);
  }
  return pRect;
}