Is there a way to increase max recursion level? For example this code is using recursion to fill an area with a color but the job is interrupted because of reaching the recursion limit! #include <GDIPlus.au3> $sRegPath = "HKLM\SOFTWARE\AutoIt v3\AutoIt" If StringInStr("X64IA64", @OSArch) Then $sRegPath = StringReplace($sRegPath, "SOFTWARE", "SOFTWARE\Wow6432Node") _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile(RegRead($sRegPath, "InstallDir") & "\Examples\GUI\logo4.gif") $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("Test", $iW, $iH) GUISetState() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGUI) AdlibRegister("UpdateView", 10) $iColor2Fill = 0xFFFFFFFF ;~ _GDIPlus_FloodFillRec($hImage, 0, 0, 0xFF000080, 0xFFFFFF00) _GDIPlus_FloodFillRec($hImage, 82, 24, 0xFF000080, 0xFFFFFF00) _GDIPlus_ImageSaveToFile($hImage, @ScriptDir & "\Filled.png") ;~ ShellExecute(@ScriptDir & "\Filled.png") AdlibUnRegister("UpdateView") ConsoleWrite("Done" & @LF) Do Until GUIGetMsg() = -3 _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() Exit Func _GDIPlus_FloodFillRec(ByRef $hBitmap, $iX, $iY, $iColorOld, $iColorNew) ;coded by UEZ 2013-01-12 Local Static $iRec = 1 Local $aResult = DllCall($ghGDIPDll, "uint", "GdipBitmapGetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint*", 0) If $aResult[4] = "0x" & Hex($iColorOld, 8) Then DllCall($ghGDIPDll, "uint", "GdipBitmapSetPixel", "handle", $hBitmap, "int", $iX, "int", $iY, "uint", $iColorNew) Else Return 0 EndIf Local $iRecLimit = 3899 $aResult = DllCall($ghGDIPDll, "uint", "GdipGetImageDimension", "handle", $hBitmap, "float*", 0, "float*", 0) If ($iX + 1) < $aResult[2] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX + 1, $iY, $iColorOld, $iColorNew) ;go east $iRec -= 1 EndIf If ($iY + 1) < $aResult[3] + 1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY + 1, $iColorOld, $iColorNew) ;go south $iRec -= 1 EndIf If ($iX - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX - 1, $iY, $iColorOld, $iColorNew) ;go west $iRec -= 1 EndIf If ($iY - 1) > -1 Then $iRec += 1 If $iRec = $iRecLimit Then Return -1 _GDIPlus_FloodFillRec($hBitmap, $iX, $iY - 1, $iColorOld, $iColorNew) ;go north $iRec -= 1 EndIf Return 1 EndFunc ;==>_GDIPlus_FloodFillRec Func UpdateView() _GDIPlus_GraphicsDrawImage($hGfx, $hImage, 0, 0) EndFunc Br, UEZ