ExcelDna.IntelliSense.WindowWatcher.TryInitialize C# (CSharp) Метод

TryInitialize() публичный Метод

public TryInitialize ( ) : void
Результат void
        public void TryInitialize()
        {
            // Debug.Print("### WindowWatcher TryInitialize on thread: " + Thread.CurrentThread.ManagedThreadId);
            var focusedWindowHandle = Win32Helper.GetFocusedWindowHandle();
            string className = null;
            if (focusedWindowHandle != IntPtr.Zero)
                className = Win32Helper.GetClassName(_focusedWindowHandle);

            UpdateFocus(focusedWindowHandle, className);
        }

Usage Example

Пример #1
0
        void RunUIAutomation(string xllPath)
        {
            // NOTE: Add for separate UI Automation Thread
            _syncContextAuto = new WindowsFormsSynchronizationContext();
            //_syncContextAuto = _syncContextMain;

            _windowWatcher      = new WindowWatcher(xllPath);
            _formulaEditWatcher = new FormulaEditWatcher(_windowWatcher, _syncContextAuto);
            _popupListWatcher   = new PopupListWatcher(_windowWatcher, _syncContextAuto);

            _windowWatcher.MainWindowChanged      += OnMainWindowChanged;
            _popupListWatcher.SelectedItemChanged += OnSelectedItemChanged;
            _formulaEditWatcher.StateChanged      += OnStateChanged;

            _windowWatcher.TryInitialize();
            // NOTE: Add for separate UI Automation Thread
            Application.Run();
        }
All Usage Examples Of ExcelDna.IntelliSense.WindowWatcher::TryInitialize