Opened 15 years ago

Last modified 15 years ago

#1077 closed Bug

GUICtrlSetBkColor excessive recoloring == faulty coloring, and strange WinGUI behavior — at Initial Version

Reported by: Mulder Owned by:
Milestone: 3.3.1.2 Component: AutoIt
Version: 3.3.0.0 Severity: None
Keywords: GUICtrlSetBkColor Cc:

Description

Tested on Win2000 and XP
On XP its just wrong coloring
on Win2000 coloring in the Autoit GUI is wrong and the WinGUI (explorer.exe) behavior is very strange.
Parts of background windows show up other on top windows are hidden ...

This bug started after v3.2.0.1 and v3.2.10.0
On v3.2.0.1 you can run the script and everthing is fine
After v3.2.10.0 you can run the script and everthing is fine except that some strange black lines are rendered during recoloring
After v3.2.12.0-rc4 and ~12000 loops you run into the described problem

I tried to make a screenshot of it
but when the AutoitGUI run in this problem
and i press the print-button i recive a "out of memory" error
I own 4Gig ram (only 3.n GB free)
Process explorer don't show heavy ram usage!

What am i doing
I repaint the backgroundcolor of an edit field
normaly every 250ms in this test without any sleep
to realize a color gradient effect over time

I've attached the script
it seems that there are some problems with char caret
{{
Opt("GUIOnEventMode", 1)

;#include <GUIConstantsEX.au3>
;#include <EditConstants.au3>
#include <Constants.au3>
#include <GUIConstants.au3>

Global $GUIheight = 520
Global $GUIwidth = 515
Global $GUIcurHEIGHT = 10

Global $mainwindow = GUICreate("UfoAI win32 buildscript",$GUIheight,$GUIheight)
; GUISetBkColor( 0x000000, $mainwindow )
; GUICtrlSetDefColor( 0xC0C0C0, $mainwindow )

GUISetOnEvent( $GUI_EVENT_CLOSE, "MainWindow" )

Global $Input = GUICtrlCreateInput( "", 10, $GUIcurHEIGHT, $GUIwidth-75, 20 )

GUISetState()

Local $counter, $rand1, $rand2, $color[3]=[255,00,00]

while 1

$counter+=1

; if $counter > 12200 then Sleep(100)

GUICtrlSetData( $Input, $counter, "" )

; sleep(1)

if $color[$rand2] = $rand1 then

$rand1 = Random( 1, 255, 1 )
$rand2 = Random( 0, 2, 1 )

else

if $rand1 < $color[$rand2] then

$color[$rand2] -= 1

else

$color[$rand2] += 1

endif

endif

; GUICtrlSetBkColor( $Input, $color[0]*216 + $color[1]*28 + $color[2] )

Color( $Input, $color[0]*216 + $color[1]*28 + $color[2] )

WEnd

Func MainWindow()

If @GUI_WINHANDLE = $mainwindow Then

exit

endif

EndFunc

Func color($var1,$var2)

GUICtrlSetBkColor( $var1, $var2 )

EndFunc
}}

Change History (1)

Changed 15 years ago by Mulder

The script as a txt file

Note: See TracTickets for help on using tickets.