private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            m_DefaultTemplate = Properties.Settings.Default.DefaultTemplate;

            // Register event interest with the PowerPoint Application
            Application.WindowActivate    += new Microsoft.Office.Interop.PowerPoint.EApplication_WindowActivateEventHandler(Application_WindowActivate);
            Application.PresentationClose += new Microsoft.Office.Interop.PowerPoint.EApplication_PresentationCloseEventHandler(Application_PresentationClose);

            // PowerPoint doesn't raise an event when it loses or gains app focus
            m_AppWatcher = new AppWatcher();
            m_AppWatcher.OnWindowHasFocus  += new WindowHasFocus(AppWatcher_OnWindowHasFocus);
            m_AppWatcher.OnWindowLostFocus += new WindowLostFocus(AppWatcher_OnWindowLostFocus);
            m_AppWatcher.Start(Application.HWND);

            // Add the button to the Office toolbar
            AddToolbar();
        }
Ejemplo n.º 2
0
        private void ThisAddIn_Startup(object sender, System.EventArgs e)
        {
            m_DefaultTemplate = Properties.Settings.Default.DefaultTemplate;

             // Register event interest with the PowerPoint Application
             Application.WindowActivate += new Microsoft.Office.Interop.PowerPoint.EApplication_WindowActivateEventHandler(Application_WindowActivate);
             Application.PresentationClose += new Microsoft.Office.Interop.PowerPoint.EApplication_PresentationCloseEventHandler(Application_PresentationClose);

             // PowerPoint doesn't raise an event when it loses or gains app focus
             m_AppWatcher = new AppWatcher();
             m_AppWatcher.OnWindowHasFocus += new WindowHasFocus(AppWatcher_OnWindowHasFocus);
             m_AppWatcher.OnWindowLostFocus += new WindowLostFocus(AppWatcher_OnWindowLostFocus);
             m_AppWatcher.Start(Application.HWND);

             // Add the button to the Office toolbar
             AddToolbar();
        }