private void initalize() { #region OoTopWindowObserver initialization try { tpwndo.WindowActivated += new EventHandler <OoEventArgs>(tpwndo_WindowActivated); //tpwndo.Disposing += new EventHandler<OoEventArgs>(tpwndo_Disposing); tpwndo.WindowClosed += new EventHandler <OoEventArgs>(tpwndo_WindowClosed); //tpwndo.WindowClosing += new EventHandler<OoEventArgs>(tpwndo_WindowClosing); //tpwndo.WindowDeactivated += new EventHandler<OoEventArgs>(tpwndo_WindowDeactivated); tpwndo.WindowMinimized += new EventHandler <OoEventArgs>(tpwndo_WindowMinimized); tpwndo.WindowNormalized += new EventHandler <OoEventArgs>(tpwndo_WindowNormalized); tpwndo.WindowOpened += new EventHandler <OoEventArgs>(tpwndo_WindowOpened); } catch (System.Exception ex) { Logger.Instance.Log(LogPriority.ALWAYS, this, "Accessibility Observer TopWindowObserever initialization failed", ex); } #endregion #region TopWindow initialization var tpwnds = OoAccessibility.GetAllTopWindows(); foreach (var item in tpwnds) { tpwndo_WindowOpened(this, new OoEventArgs(item)); } initalized = true; var actTpwnd = OoAccessibility.GetActiveTopWindow(); if (actTpwnd != null) { tpwndo_WindowActivated(this, new OoEventArgs(actTpwnd)); } #endregion }
/// <summary> /// Gets the active OpenOffice top window. /// </summary> /// <returns>The current active top window object.</returns> public static Object GetActiveTopWindow() { return(OoAccessibility.GetActiveTopWindow()); }