View Issue Details

IDProjectCategoryView StatusLast Update
0002059JEDI VCL00 JVCL Componentspublic2004-08-17 13:18
ReporterglchapmanAssigned Touser72 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version 
Summary0002059: TJvFormAnimation deletes regions after call to SetWindowRgn
DescriptionThe AnimateAppear and AnimateDisappear methods of TJvFormAnimation iterate through the regions in the FRegions array, calling SetWindowRgn with each of them. They then call DeleteRegions which calls DeleteObject on these regions. According to the SDK documentation, you are not supposed to delete region handles once they have been passed to SetWindowRgn. In this case, it appears to be basically harmless since once these regions have been replaced as the window rgn by a subsequent call to SetWindowRgn, GDI detects them as invalid and returns 0 from the call to DeleteObject. Anyway, you might want to rewrite the loops to be something like:

  for I := 0 to N do
  begin
    if SetWindowRgn(FForm.Handle, FRegions[I], True) <> 0 then
      FRegions[I]:= 0;
    FForm.Repaint;
    Sleep(10);
  end;

And in DeleteRegions:

  for I := Low(FRegions) to High(FRegions) do
    if FRegions[I] <> 0 then
      DeleteObject(FRegions[I]);
TagsNo tags attached.

Activities

user72

2004-08-17 13:18

  ~0005010

Thanks, Updated in CVS

Issue History

Date Modified Username Field Change
2004-08-16 15:23 glchapman New Issue
2004-08-17 13:18 user72 Status new => resolved
2004-08-17 13:18 user72 Resolution open => fixed
2004-08-17 13:18 user72 Assigned To => user72
2004-08-17 13:18 user72 Note Added: 0005010