Modify ↓
Opened 12 years ago
Closed 12 years ago
#2627 closed Bug (No Bug)
WinExists not working on Windows 8
| Reported by: | Owned by: | ||
|---|---|---|---|
| Milestone: | Component: | AutoIt | |
| Version: | 3.3.8.1 | Severity: | None |
| Keywords: | WinExists | Cc: |
Description
The following code works fine on windows 7 (32 and 64 bit), but fails on Windows 8 64 bit.
;Test for seeing if we can see notepad
;NotepadTest.au3
Opt("WinTitleMatchMode", 2)
DIM $CompletionWindowStr = "Untitled - Notepad"
$WaitCompleteResult = WinExists($CompletionWindowStr)
If ($WaitCompleteResult = 1) Then
MsgBox(1,"Info", "Notepad found", 30)
Else
MsgBox(1,"Info", "Notepad NOT found", 30)
EndIf
Exit
Test setup is open notepad, then run the above compiled program.
Under windows 7 notepad is found.
Under windows 8.0 it is not.
Attachments (0)
Change History (4)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
Does the Notepad window have the same title as it did in previous versions of windows?
comment:4 by , 12 years ago
| Resolution: | → No Bug |
|---|---|
| Status: | new → closed |
It is true that Win8 and 7 introduce a non-breaking blank in the title
"CLASS:Notepad" is better mainly when using non english windows
Note:
See TracTickets
for help on using tickets.

I found a workaround, here it is:
;Test for seeing if we can see notepad
;NotepadTest.au3
DIM $CompletionWindowStr = "Untitled - Notepad"
;$WaitCompleteResult = WinExists($CompletionWindowStr)
$WaitCompleteResult = WinExists("[CLASS:Notepad]")
If ($WaitCompleteResult = 1) Then
Else
EndIf
Exit