void InitializeHookMsg() { // Initialize the object which will make all the UIA calls on a background MTA thread. hookMsgProcessor = new HookMessageProcess(); hookMsgProcessor.Initialize(new UIListUpdateDelegate(UpdateListOnUIThread), listViewLinks); // Initialize the event handler which is called when the UIA tree structure changes in the browser window. //SampleUIEventHandlerDelegate sampleUIEventHandlerDelegate = new SampleUIEventHandlerDelegate(HandleEventOnUIThread); //_sampleEventHandler = new SampleEventHandler(this, sampleUIEventHandlerDelegate); }
private void Win7UIAutomationClient_FormClosed(object sender, FormClosedEventArgs e) { if (hookMsgProcessor != null) { hookMsgProcessor.Uninitialize(); hookMsgProcessor = null; } //if (_sampleEventHandler != null) //{ // _sampleEventHandler.Uninitialize(); // _sampleEventHandler = null; //} // Give any background threads created on startup a chance to close down gracefully. Thread.Sleep(200); }
//메시지 후킹작업 시작 private static void DoWork(object data) { HookMessageProcess hookMsgProcessor = (HookMessageProcess)data; //hookMsgProcessor.ThreadProc(); }