Custom Query


Show under each result:

Results (43 - 45 of 3866)

Ticket Resolution Summary Owner Reporter
#1794 No Bug Opt("GuiCloseOnESC", 0) causes WinClose() to be ignored AndyS01@…

When a script is compiled with Opt("GuiCloseOnESC", 0) active, another script, after getting its handle cannot close the first script. The WinClose() returns an OK status, but it really doesn't work. Compiling the first script with Opt("GuiCloseOnESC", 1) avtive works OK.

To reproduce: compile the test script, below; open a DOS window; run the compiled script; run the compiled script again. This time, there will be an error MsgBox complaining that the instance was not killed.

Change Opt("GuiCloseOnESC", 0) to Opt("GuiCloseOnESC", 1) and run the reproduce steps again. This time it works OK.

Test script:

#include <GuiConstantsEx.au3>
#include <GuiListView.au3>

[b]Opt("GuiCloseOnESC", 0)[/b]
Global $sCurrentTitle = "Test WinClose()"

runUnique() ; Kill off any currently running version of this script

$hGUI = GUICreate($sCurrentTitle, 300, 200)

$hListView = _GUICtrlListView_Create($hGUI, "Items|SubItems", 2, 2, 296, 196, $LVS_REPORT)

For $i = 1 To 10
    _GUICtrlListView_AddItem($hListView, @HOUR & ":" & @MIN & ":" & @SEC & " - " & $i)
    _GUICtrlListView_AddSubItem($hListView, $i - 1, "SubItem " & $i, 1)


exit (1)

Func runUnique()
    Local $hWnd, $res, $title = $sCurrentTitle

    if (WinActivate($title, "") <> 0) Then
        $hWnd = WinGetHandle($title, "")
        If (Not IsHWnd($hWnd)) Then $hWnd = HWnd($hWnd)
        if (IsHWnd($hWnd)) Then
            $res = WinClose($hWnd)
            if ($res == 0) Then
                ConsoleWrite("+++: WinClose() failed")
                $res = WinKill($hWnd)
                ConsoleWrite("+++: WinKill() returned " & $res & @CRLF)
                if ($res == 0) Then
                    ConsoleWrite("+++: WinKill() failed")

            if (WinActivate($title, "") <> 0) Then
                MsgBox(0, "ERROR", "Cannot kill window")
                MsgBox(0, "INFO", "Killed other window")
            MsgBox(0, "ERROR", "Cannot get win handle")
EndFunc   ;==>runUnique
#3780 Completed WinSetTitle reverts to default upon window focus on Notepad.exe >= Windows 19H1 Jpm AndyS19a@…

I have a function that opens Notepad and sets its window title. However, the title reverts to whatever its default was when the Notepad window gets focus. To reproduce, run the WinSetTitle.au3 in the Examples folder, then move the cursor before the timeout expires.


Func Example()
	; Run Notepad

	; Wait 10 seconds for the Notepad window to appear.
	Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)

	; Set the title of the Notepad window using the handle returned by WinWait.
	WinSetTitle($hWnd, "", "New Notepad Title - AutoIt")

	; Wait for 2 seconds to display the Notepad window and the new title.

	; Close the Notepad window using the handle returned by WinWait.
EndFunc   ;==>Example
#591 No Bug _GUICtrlListBox_AddString goes loopy when passing array instead of string Annonymous

First of all, I know you aren't suppose to pass an array to the $sText parameter of _GUICtrlListBox_AddString(). It was a typo that led me to discover this, and if I remember correctly, Valik once said that Autoit shouldn't hard crash under any circumstance.

When passing an array (In this case from StringSplit) to _GUICtrlListBox_AddString(), it both makes Autoit Hard-crash as well as the Dr. Watson Post-mortem debugger. This is the shortest code I can reproduce this with:

#Include <GUIListBox.au3>
$hForm = GUICreate("Test", 410, 492, 193, 125)
$hList = GUICtrlCreateList("", 16, 16, 377, 383)
$azTemp = StringSplit("Test\Hello", "\")
_GUICtrlListBox_AddString($hList, $azTemp)
While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case -3


This first creates the infamous "Such-and-such has encountered a problem and needs to close" dialog. Next, after a few seconds, the same dialog appears for the Dr. Watson Post-mortem debugger (drwtsn32.exe). The Autoit script does not close, nor does it respond to an "End Process" from the Task Manager.

The only way to kill the script is to kill drwtsn32.exe. SciTE then reports the exit code to be :

!>19:42:54 AutoIT3.exe ended.rc:-1073740972

Operating System: Windows XP (English) SP2.

Note: See TracQuery for help on using queries.