MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / OnEvent

Method OnEvent

source/script_gui.cpp:2387–2405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2385
2386
2387ResultType GuiType::OnEvent(GuiControlType *aControl, UINT aEvent, UCHAR aEventKind
2388 , ExprTokenType *aParam[], int aParamCount, ResultToken &aResultToken)
2389{
2390 // Caller has already converted aParam[0] to aEvent and validated it,
2391 // as well as verifying aParamCount >= 2.
2392 int max_threads = ParamIndexToOptionalInt(2, 1);
2393 if (max_threads < -1 || max_threads > 1)
2394 // An event can currently only run one thread at a time. By contrast, OnMessage
2395 // applies the thread limit per handler, not per message. It's hard to say which
2396 // approach is better.
2397 _o_throw_param(2);
2398
2399 TCHAR nbuf[MAX_NUMBER_SIZE];
2400 IObject *func = ParamIndexToObject(1);
2401 LPTSTR name = func ? nullptr : ParamIndexToString(1, nbuf);
2402 if (!func && !mEventSink)
2403 _o_throw_param(1);
2404 return OnEvent(aControl, aEvent, aEventKind, func, name, max_threads, aResultToken);
2405}
2406
2407
2408ResultType GuiType::OnEvent(GuiControlType *aControl, UINT aEvent, UCHAR aEventKind

Callers 1

InvokeMethod · 0.80

Calls 5

ValidateFunctorFunction · 0.85
AddMethod · 0.80
MemoryErrorMethod · 0.80
FindMethod · 0.45
DeleteMethod · 0.45

Tested by

no test coverage detected