procedure WinAPI_SetDraggableRegions(draggable_region: HRGN; regionsCount: NativeUInt; const regions: TCefDraggableRegionArray); extdecl;
{$ifdef MSWINDOWS}
var
region: HRGN;
idx, count: Integer;
dragRegion: TCefDraggableRegion;
{$endif}
begin
{$ifdef MSWINDOWS}
//region = ::CreateRectRgn(it->bounds.x, it->bounds.y, it->bounds.x + it->bounds.width, it->bounds.y + it->bounds.height);
SetRectRgn(draggable_region, 0, 0, 0, 0);
count := Integer(regionsCount);
for idx := 0 to count do
begin
dragRegion := regions[idx];
region := CreateRectRgn(dragRegion.bounds.x, dragRegion.bounds.y, dragRegion.bounds.x + dragRegion.bounds.width, dragRegion.bounds.y + dragRegion.bounds.height);
if dragRegion.draggable = 1 then
CombineRgn(draggable_region, draggable_region, region, RGN_OR)
else
CombineRgn(draggable_region, draggable_region, region, RGN_DIFF);
DeleteObject(region);
end;
{$endif}
end;