GetThemePartSize function uxtheme
Calculates the original size of the part defined by a visual style.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/uxtheme/nf-uxtheme-getthemepartsize.
Implementation
Pointer<SIZE> GetThemePartSize(
HTHEME hTheme,
HDC? hdc,
int iPartId,
int iStateId,
Pointer<RECT>? prc,
THEMESIZE eSize,
) {
final psz = adaptiveCalloc<SIZE>();
final hr$ = HRESULT(
_GetThemePartSize(
hTheme,
hdc ?? nullptr,
iPartId,
iStateId,
prc ?? nullptr,
eSize,
psz,
),
);
if (hr$.isError) {
free(psz);
throw WindowsException(hr$);
}
return psz;
}