[a103] - SendMessage [BUG] Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
_3D_
Posts: 277
Joined: 29 Jan 2014, 14:40

[a103] - SendMessage [BUG]

16 Jun 2019, 23:57

AutoHotkey_2.0-a103-56441b52
Working example till [a103]

Code: Select all

DetectHiddenWindows("ON")
OnMessage(0x2000, ()=>(MsgBox("ASD")))

1::SendMessage(0x2000,,,,"ahk_id " A_ScriptHWND)
Q::ExitApp
Now:

Code: Select all

---------------------------
ahk-test-code.ahk
---------------------------
Error:  Too many parameters passed to function.

	Line#
	004: DetectHiddenWindows("ON")
	005: {
	005: Return (MsgBox("ASD"))
	005: }
	005: OnMessage(0x2000, ()=>(MsgBox("ASD")))
	007: Return
--->	007: SendMessage(0x2000,,,,"ahk_id " A_ScriptHWND)
	007: Return
	008: ExitApp()
	008: Return
	009: Exit
	010: Exit
	010: Exit

The current thread will exit.
---------------------------
OK   
---------------------------
AHKv2.0 alpha forever.
Helgef
Posts: 4709
Joined: 17 Jul 2016, 01:02
Contact:

Re: [a103] - SendMessage [BUG]  Topic is solved

17 Jun 2019, 00:07

a103 wrote:Changed function calls to throw if too many parameters are passed.
Added fn(a,*) as a means to permit but not store surplus parameters.
OnMessage(0x2000, ()=>(MsgBox("ASD")))
:arrow:
OnMessage(0x2000, (*)=>(MsgBox("ASD")))

Cheers.

Edit: The error points on the sendmessage line, which is misleading, but if you name the fat arrow function, it will probably tell you the name.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: kunkel321, mikeyww, UserNameForAH_Board and 69 guests