/// <summary>
        /// invoke user call back
        /// </summary>
        /// <param name="wnd"></param>
        /// <param name="appEvent"></param>
        private static void ApplicationStatus(WindowData wnd, ApplicationEvents appEvent)
        {
            var timeStamp = DateTime.Now;

            wnd.AppTitle = appEvent == ApplicationEvents.Closed ? wnd.AppTitle : WindowHelper.GetWindowText(wnd.HWnd);
            wnd.AppPath  = appEvent == ApplicationEvents.Closed ? wnd.AppPath : WindowHelper.GetAppPath(wnd.HWnd);
            wnd.AppName  = appEvent == ApplicationEvents.Closed ? wnd.AppName : WindowHelper.GetAppDescription(wnd.AppPath);

            OnApplicationWindowChange?.Invoke(null, new ApplicationEventArgs()
            {
                ApplicationData = wnd, Event = appEvent
            });
        }
Esempio n. 2
0
        /// <summary>
        ///     invoke user call back
        /// </summary>
        private void ApplicationStatus(WindowData wnd, ApplicationEvents appEvent)
        {
            var timeStamp = DateTime.Now;

            if (appEvent != ApplicationEvents.Closed)
            {
                UpdateWindowData(wnd);
            }

            OnApplicationWindowChange?.Invoke(null,
                                              new ApplicationEventArgs {
                ApplicationData = wnd, Event = appEvent
            });
        }