Show / Hide Table of Contents

Method elm.fromEvent


Overload

Gets the UI element that generated the event that is currently being processed by the callback function used with API SetWinEventHook or WinEventHook.

public static elm fromEvent(wnd w, EObjid idObject, int idChild)
Parameters
w  (wnd)
idObject  (EObjid)
idChild  (int)
Returns
elm

null if failed. Supports lastError.

Remarks

The parameters are of the callback function. Uses API AccessibleObjectFromEvent. Often fails because the UI element already does not exist, because the callback function is called asynchronously, especially when the event is OBJECT_DESTROY, OBJECT_HIDE, SYSTEM_*END. Returns null if failed. Always check the return value, to avoid NullReferenceException. An exception in the callback function kills this process.