Modify ↓
Opened 11 years ago
Closed 11 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 by , 11 years ago
| Milestone: | → 3.3.15.0 |
|---|---|
| Owner: | set to |
| Resolution: | → Fixed |
| Status: | new → closed |
Note:
See TracTickets
for help on using tickets.

Fixed by revision [11407] in version: 3.3.15.0