id summary reporter owner description type status milestone component version severity resolution keywords cc 2748 _WinAPI_SaveHBITMAPToFile in WinAPIGdi.au3 is bugged anonymous guinness "_WinAPI_SaveHBITMAPToFile may break as reported by SciTE's console: ""C:\Program Files (x86)\AutoIt3\Include\WinAPIGdi.au3"" (3702) : ==> Variable used without being declared.: _WinAPI_CloseHandle($hFile) _WinAPI_CloseHandle(^ ERROR That is because the declaration of variable $hFile is now within a loop (line 3683), which may or may not be executed, while the variable is still being used outside that loop. Furthermore, it is not saving the bitmap in many situations, failing at line 3616 (_WinAPI_DrawBitmap). Apparently, a false report, because if one forces the assignment ""$hBitmap = $hSource"", regardless of the status returned by _WinAPI_DrawBitmap, the bitmap is saved correctly. As a last consideration, the example found at the help file page for _WinAPI_SaveHBITMAPToFile fails when run, saving a bitmap which turns out to be just a block painted in black." Bug closed 3.3.13.0 AutoIt 3.3.12.0 None Fixed bitmap file