[a103] - SendMessage [BUG] 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.
_3D_
Posts: 211
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 use the future now.
Helgef
Posts: 3783
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 “AutoHotkey v2 Help”

Who is online

Users browsing this forum: No registered users and 1 guest