示例#1
0
 /// <summary>
 ///     Create a WinEventInfo instance
 /// </summary>
 /// <param name="winEventHook">
 ///     Handle to an event hook function. This value is returned by SetWinEventHook when the hook
 ///     function is installed and is specific to each instance of the hook function.
 /// </param>
 /// <param name="winEvent">Specifies the event that occurred. This value is one of the event constants.</param>
 /// <param name="hWnd">
 ///     Handle to the window that generates the event, or NULL if no window is associated with the event.
 ///     For example, the mouse pointer is not associated with a window.
 /// </param>
 /// <param name="idObject">
 ///     Identifies the object associated with the event. This is one of the object identifiers or a
 ///     custom object ID.
 /// </param>
 /// <param name="idChild">
 ///     Identifies whether the event was triggered by an object or a child element of the object. If this
 ///     value is CHILDID_SELF, the event was triggered by the object; otherwise, this value is the child ID of the element
 ///     that triggered the event.
 /// </param>
 /// <param name="eventThread">Identifies the thread that generated the event, or the thread that owns the current window.</param>
 /// <param name="eventTime">Specifies the time, in milliseconds, that the event was generated.</param>
 /// <returns></returns>
 public static WinEventInfo Create(IntPtr winEventHook, WinEvents winEvent, IntPtr hWnd, ObjectIdentifiers idObject, long idChild, ulong eventThread, ulong eventTime)
 {
     return(new WinEventInfo
     {
         EventHook = winEventHook,
         WinEvent = winEvent,
         Handle = hWnd,
         ObjectIdentifier = idObject,
         IdChild = idChild,
         EventThread = eventThread,
         EventTime = eventTime
     });
 }
示例#2
0
 public static IDisposable Subscribe(this IObserver <WinEventInfo> observer, WinEvents winEvent, ObjectIdentifiers objectIdentifiers)
 {
     return(Subscribe(observer, winEvent, winEvent, objectIdentifiers));
 }
示例#3
0
 public static IDisposable Subscribe(this IObserver <WinEventInfo> observer, WinEvents winEventStart, WinEvents winEventEnd, ObjectIdentifiers objectIdentifiers)
 {
     return(WinEventHook
            .Create(winEventStart, winEventEnd)
            .Where(x => x.IdChild == CHILDID_SELF && x.ObjectIdentifier == objectIdentifiers)
            .Subscribe(observer));
 }
示例#4
0
 public static extern bool GetScrollBarInfo(IntPtr hwnd, ObjectIdentifiers idObject, ref ScrollBarInfo scrollBarInfo);