Error: Target Window not found Topic is solved

Get help for the alpha version of AutoHotkey v2 here. Please state the v2 version you are working with in the title when making a new topic.
gqqnbig
Posts: 13
Joined: 27 Jul 2014, 15:00

Error: Target Window not found

Post by gqqnbig » 22 Jun 2020, 08:22

I'm running

ProcessName:=WinGetProcessName("A")
批注 2020-06-22 212208.png
批注 2020-06-22 212208.png (21.58 KiB) Viewed 1404 times

The code sometimes gives error: Target Window not found.

I checked the documentation, but failed to find related information.

When does this error happen? How do I deal with it? Is it documented anywhere?

I'm using Autohotkey v2 a112.

Helgef
Posts: 4479
Joined: 17 Jul 2016, 01:02
Contact:

Re: Error: Target Window not found

Post by Helgef » 22 Jun 2020, 12:53

I think the documentation is just not up to-date and that this is the expected behaviour. Use try or winexist.

Cheers.

lexikos
Posts: 7088
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Error: Target Window not found  Topic is solved

Post by lexikos » 22 Jun 2020, 22:51

This occurs when there is no active window (or the active window is not "found" because DetectHiddenWindows is false).

gqqnbig
Posts: 13
Joined: 27 Jul 2014, 15:00

Re: Error: Target Window not found

Post by gqqnbig » 24 Jun 2020, 06:33

Thank all you guys.

Post Reply

Return to “AutoHotkey v2 Help”