Тема: AHK: RegisterCallback() и количество параметров
В справке написано, что при создании колбека нужно убедиться, что количество параметров у вызова и принимающей функции должны совпадать.
А почему не написано.
Чем теоретически может обернуться если их количество совпадать не будет?
Например:
EnumAddress := RegisterCallback("EnumWindowsProc", "Fast")
DllCall("EnumWindows", "Ptr", EnumAddress, "Ptr", 0)
MsgBox %Output% ; Display the information accumulated by the callback.
EnumWindowsProc(hwnd, lParam, temp1, temp2, temp3) ; 5 параметров вместо 2
{
global Output
WinGetTitle, title, ahk_id %hwnd%
WinGetClass, class, ahk_id %hwnd%
if title
Output .= "HWND: " . hwnd . "`tTitle: " . title . "`tClass: " . class . "`n"
return true ; Tell EnumWindows() to continue until all windows have been enumerated.
}