Exemplo n.º 1
0
        /// <summary>
        /// Event handler that is called when <see cref="ParentForm" /> is in the process of closing.  This uninstalls <see cref="HookProc" /> from the low-level hooks list and stops the consumer thread that processes those events
        /// </summary>
        /// <param name="sender">Object from which this event originated, <see cref="ParentForm" /> in this case</param>
        /// <param name="e">Arguments associated with this event</param>
        private void ParentFormOnClosing(object sender, CancelEventArgs e)
        {
            TitleBarTabs form = (TitleBarTabs)sender;

            if (form == null)
            {
                return;
            }
            if (s_parents.ContainsKey(form))
            {
                s_parents.Remove(form);
            }
            User32.UnhookWindowsHookEx(HookID);
            MouseEvents.CompleteAdding();
            MouseEventsThread.Abort();
        }