Opened 5 years ago

Last modified 5 years ago

#3745 closed Bug

bug appears on windows 10, writing to edit control freezes script and crashes it. — at Version 2

Reported by: TheAutomator Owned by: Melba23
Milestone: Component: AutoIt
Version: 3.3.14.0 Severity: None
Keywords: edit, gui, write, append, text Cc:

Description (last modified by mLipok)

referring tho this weird bug:

https://www.autoitscript.com/forum/topic/201263-async-soundplay-freezes-gui/?tab=comments#comment-1445495

my code:

#include <guiconstantsex.au3>
#include <buttonconstants.au3>
#include <windowsconstants.au3>
#include <guiedit.au3>

;--------------------------------------------------------------------------------------------------

const $form = guicreate('TypingError', 600, 400, default, default, bitor($gui_ss_default_gui,$ws_maximizebox,$ws_sizebox,$ws_thickframe,$ws_tabstop))
    guisetbkcolor(0x400000)
    const $console = guictrlcreateedit('loading...', 10, 10, 581, 341, bitor($es_autovscroll,$es_readonly,$es_wantreturn,$ws_vscroll), 0)
        guictrlsetfont(default, 12, 800, 0, 'consolas')
        guictrlsetcolor(default, 0xffffff)
        guictrlsetbkcolor(default, 0x000000)
        guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_docktop,$gui_dockbottom))
        guictrlsetcursor (default, 3)
    const $user = guictrlcreateinput('', 10, 360, 521, 30, default, 0)
        guictrlsetfont(default, 14, 800, 0, 'consolas')
        guictrlsetcolor(default, 0xffffff)
        guictrlsetbkcolor(default, 0x000000)
        guictrlsetresizing(default, bitor($gui_dockleft,$gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight))
    const $send = guictrlcreatebutton('send', 540, 360, 51, 31, bitor($es_uppercase,$bs_defpushbutton,$ws_disabled))
        guictrlsetresizing(default, bitor($gui_dockright,$gui_dockbottom,$gui_dockwidth,$gui_dockheight))
        guictrlsetcursor (default, 0)
guisetstate(@sw_show)

;--------------------------------------------------------------------------------------------------

Global $clear = False
func WRITE($message)
    if $clear then
        $clear = False
    else
        _guictrledit_appendtext($console, @crlf)
    endif
    ADD($message)
endfunc

Func ADD($message)
    for $i = 1 to stringlen($message)
        sleep(50)
        _guictrledit_appendtext($console, stringmid($message, $i, 1))
    next
EndFunc

func READ()
    guictrlsetstate($send, $gui_enable)
    while 1
        switch guigetmsg()
            case $gui_event_close
                exit
            case $send
                guictrlsetstate($send, $gui_disable)
                local $answer = guictrlread($user)
                guictrlsetdata($user, '')
                return $answer
        endswitch
    wend
endfunc

HotKeySet('{esc}','quit')
func QUIT()
    write("goodbye...")
    exit
endfunc

;--------------------------------------------------------------------------------------------------

write('this a test of a string with the ' & @CRLF & 'character in it...')
read()
Sleep(1000)
$clear = True
GUICtrlSetData($console, '')
write('this a test of qdfgdqfgqdfga string with the ' & @CRLF & 'character in it...');PROBLEM!
read()
write('this a test oqdgff a string with the ' & @CRLF & 'character in it...')
read()
write('this a t... cbgfshf...e?' & @CRLF & 'character in it...')
read()
write('done')

Change History (3)

comment:1 Changed 5 years ago by Melba23

  • Owner set to Melba23
  • Status changed from new to assigned

comment:2 Changed 5 years ago by mLipok

  • Description modified (diff)
Note: See TracTickets for help on using tickets.