Error: Target Window not found Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
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 3408 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: 4709
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: 9560
Joined: 30 Sep 2013, 04:07
Contact:

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 “Ask for Help (v2)”