nsoft test
Posts: 10
Joined: 2012-11-06
|
Thanks Sergey!
Will try that and get back to you ASAP. |
|
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!! |
|
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! |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
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");
}
}
}
|
|