Nonexistent function WinGetTitle() 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.
Dok
Posts: 4
Joined: 10 Aug 2020, 15:18

Nonexistent function WinGetTitle()

12 Aug 2020, 12:40

When I try to compile my script using Unicode 64-bit.bin, I get an error. Is this a bug or am I doing something wrong?

The script contains syntax errors.
Specifically: WinGetTitle("ahk_pid " CSGOPid) = A_Args[2])


My code:

Code: Select all

Run "`"" A_Args[1] "\Steam.exe`" -login " A_Args[2] " " A_Args[3] " -applaunch 730 -novid -low -nohltv -nosound -novid -window -w 640 -h 480 +exec " A_Args[4] " -x " A_Args[5] " -y " A_Args[6],,, SteamPID

GetCSGOPid(SteamPID)

Loop {
	WinSetTitle A_Args[2], "ahk_pid " CSGOPid
	If(WinGetTitle("ahk_pid " CSGOPid) = A_Args[2])
		Exit
	Sleep 1000
}


GetCSGOPid(ValuePID){
	Global CSGOPid
	Processes := ComObjGet("winmgmts:").ExecQuery("Select * from Win32_Process")
	ParentPID := "," ValuePID ","
	for Process in Processes
		If InStr(ParentPID, "," Process.ParentProcessId "," ){
			If (process.name = "csgo.exe")
				CSGOPid := process.ProcessID
		}
}
swagfag
Posts: 4142
Joined: 11 Jan 2017, 17:59

Re: Nonexistent function WinGetTitle()

12 Aug 2020, 15:38

dont compile it with v1's Unicode 64-bit.bin
there are no syntax errors in this script(compiled or otherwise)
Dok
Posts: 4
Joined: 10 Aug 2020, 15:18

Re: Nonexistent function WinGetTitle()

12 Aug 2020, 16:07

swagfag wrote:
12 Aug 2020, 15:38
dont compile it with v1's Unicode 64-bit.bin
there are no syntax errors in this script(compiled or otherwise)
Yeah, it's true but i use this file from v2 version
dBcmnYZ.png
dBcmnYZ.png (2.53 KiB) Viewed 1201 times
swagfag
Posts: 4142
Joined: 11 Jan 2017, 17:59

Re: Nonexistent function WinGetTitle()

12 Aug 2020, 16:57

so do i, and it compiles fine
again, the script ure showing contains no v2 syntax errors. if ure getting any:
  • ure using a different script that the one posted here
  • there's some other problem specific to ur environment
lexikos
Posts: 7200
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

Re: Nonexistent function WinGetTitle()

12 Aug 2020, 22:27

Syntax errors are detected by passing the script to AutoHotkey.exe. I don't think Ahk2Exe detects which version it would need to use for this purpose. For compiling v2 scripts, you would need to create a separate copy of the compiler folder, with AutoHotkey.exe (v2) up one directory level from Ahk2Exe.exe.
Dok
Posts: 4
Joined: 10 Aug 2020, 15:18

Re: Nonexistent function WinGetTitle()  Topic is solved

13 Aug 2020, 03:41

lexikos wrote:
12 Aug 2020, 22:27
Syntax errors are detected by passing the script to AutoHotkey.exe. I don't think Ahk2Exe detects which version it would need to use for this purpose. For compiling v2 scripts, you would need to create a separate copy of the compiler folder, with AutoHotkey.exe (v2) up one directory level from Ahk2Exe.exe.
I previously copied the file ahk2exe.exe to a separate folder with version v2.

Today I renamed the folder with AutoHotkey v1, and oddly enough, the compiler started using AutoHotkey.exe from the second version and the script was successfully compiled. As @swagfag said it was some other problem specific to my environment. Thanks for the help

Return to “AutoHotkey v2 Help”

Who is online

Users browsing this forum: w64bit and 6 guests