Modify

Opened 10 years ago

Closed 9 years ago

#2899 closed Bug (Fixed)

WinGetHandle("LAST") : document unclear and @error bug

Reported by: anonymous Owned by: Jon
Milestone: 3.3.15.0 Component: AutoIt
Version: 3.3.12.0 Severity: None
Keywords: Cc:

Description

The documentation state that

WinGetHandle("[LAST]")

should return "Last window used in a previous AutoIt command" (in "Window Titles and Text" section), and (in "WinGetHandle" section) "sets the @error flag to non-zero if the window is not found."

GUICreate("Test")
GUISetBkColor(0x0)
GUISetState()
;Local $hWin = WinGetHandle("[ACTIVE]")
;WinMove($hWin, "", 0, 0)

Local $hWin1 = WinGetHandle("[LAST]")
ConsoleWrite($hWin1 & ' - ' & @error  & ' - '& VarGetType($hWin1))
Sleep(2000)

First, the documentation do not say that it's only return the window which is processed with only Win...() function but not GUI...() function. This can make people misunderstood.
Second, when no previous window is found, it NOT set @error at all. In the example above, it return a pointer with value 0, and @error also set to 0.

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by Jon

  • Milestone set to 3.3.15.0
  • Owner set to Jon
  • Resolution set to Fixed
  • Status changed from new to closed

Fixed by revision [11407] in version: 3.3.15.0

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The owner will remain Jon.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.