Events in IE not catched

Add-in Express™ Support Service
That's what is more important than anything else

Events in IE not catched
 
nsoft test




Posts: 10
Joined: 2012-11-06
Thanks Sergey!

Will try that and get back to you ASAP.
Posted 29 Nov, 2012 10:57:24 Top
nsoft test




Posts: 10
Joined: 2012-11-06
Hi Sergey,

Thank you very much! You helped me alot with the events and now using design time it works!
I now get some good events which help me, but there is only one thing left: the events of the minimize of the browser.

Any direction to how I can get this specific event to popup? I would like to close my addin when this happens.

Thanks alot!!
Posted 30 Nov, 2012 16:39:38 Top
nsoft test




Posts: 10
Joined: 2012-11-06
Hi Sergey,

Thanks alot for checking! You helped me a lot and this indeed handled most of the problems on the project.
I have one more event I cannot get: When the browser is minimized.

Could you please let me know how I can subscribe to this specific event? I tried all the relevant events and couldn't get it to call me on this minimize event.

these are the events I tried (Ignore the commented lines as all events obviously were tested):



        private void adxiehtmlDocEvents1_OnLoseCapture(object sender, object eventObject)
        {
            //Application.Exit();
        }

        private void adxiehtmlDocEvents1_OnResize(object sender, object eventObject)
        {
            Application.Exit();
            //HTMLDocumentText = "OnResize";
        }

        private void IEModule_OnVisible_1(bool visible)
        {
            //Application.Exit();
            if (!visible)
            {
                //HTMLDocumentText = "OnVisible";
            }
        }

        private void adxiehtmlDocEvents1_OnFocusOut(object sender, object eventObject)
        {
            //Application.Exit();
            //HTMLDocumentText = "OnFocusOut";
        }

        private void adxiehtmlDocEvents1_OnMouseLeave(object sender, object eventObject)
        {
            //Application.Exit();
            //HTMLDocumentText = "OnMouseLeave";
        }

        private void adxiehtmlDocEvents1_OnMouseOut(object sender, object eventObject)
        {
            //Application.Exit();

        }

        private void adxiehtmlDocEvents1_OnDeactivate(object sender, object eventObject)
        {
            Application.Exit();

        }


Thanks!
Posted 01 Dec, 2012 02:20:08 Top
Sergey Grischenko


Add-in Express team


Posts: 7202
Joined: 2004-07-05
Hi Ofear,

Please try the code below. I used the 'WindowStateChanged' event of IEModule.

        [DllImport("user32")]
        private extern static bool IsIconic(IntPtr hWnd);

        [DllImport("user32")]
        private extern static bool IsZoomed(IntPtr hWnd);

        private enum AppState
        {
            Default,
            Minimized,
            Maximized
        }

        private AppState appState = AppState.Default;

        private void IEModule_WindowStateChanged(ADXIEWindowState windowState, ADXIEWindowState validState)
        {
            if (validState == (ADXIEWindowState.wsUserVisible | ADXIEWindowState.wsEnabled))
            {
                if (IsIconic(this.MainWindowHandle))
                {
                    if (appState != AppState.Minimized)
                    {
                        appState = AppState.Minimized;

                        MessageBox.Show(this, "Minimized");
                    }
                }
                else if (IsZoomed(this.MainWindowHandle))
                {
                    if (appState != AppState.Maximized)
                    {
                        appState = AppState.Maximized;

                        MessageBox.Show(this, "Maximized");
                    }
                }
                else if (appState != AppState.Default)
                {
                    appState = AppState.Default;

                    MessageBox.Show(this, "Restored");
                }
            }
        }
Posted 03 Dec, 2012 03:30:40 Top