Close IE instance associated with module.

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

Close IE instance associated with module.
 
ravinukala




Posts: 103
Joined: 2012-10-05
Hi,

I have windows application from which I am opening IE and use plug in which is developed in Add In.

I want to close all instances of IE having my plug in when I exit from my application.

I am able to get modules by AddinExpress.IE.ADXIEModule.GetModulesByTypeName("ModuleName") method.

How can I close these IE instances?
Posted 11 Mar, 2013 08:19:30 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Hi Ravi,

You need to send a message to all modules using the 'SendMessage' method of iemodule. Then you can process the message in the 'OnSendMessage' event and close the IE tab.

private const int WM_USER = 0x0400;
private const int WM_MYMESSAGE = WM_USER + 100;

private void IEModule_OnSendMessage(ADXIESendMessageEventArgs e)
{
if (e.Message == WM_MYMESSAGE)
{
IEApp.Quit();
}
}
Posted 11 Mar, 2013 09:16:00 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi Sergey,

Thanks, it helps alot.
Posted 12 Mar, 2013 00:33:14 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi

I want to show plugin only when the browser starts from our application.

If some one start IE manually, plugin must not shown.

How can I achieve that?
Posted 12 Mar, 2013 04:08:29 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hello Ravi,

Please check http://www.add-in-express.com/creating-addins-blog/2009/06/26/ie-addon-interact-standalone-application/.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Mar, 2013 05:04:31 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi,

I am not getting any idea about how I can use said logic to achieve my objective.
Posted 12 Mar, 2013 06:34:16 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Your add-on can use that approach to check if the application is run. There's a sample project supplied with the blog. you can modify it to check whether this apporach suites your needs.


Andrei Smolin
Add-in Express Team Leader
Posted 12 Mar, 2013 06:43:15 Top
ravinukala




Posts: 103
Joined: 2012-10-05
As per your suggestion, I have put check whether application is running or not. That helps some extent.

But while application is running and user opens IE manually it is showing Addon.

See, I want to show my Addon when IE opens through my application i.e. some button click event in application.

When user manually opens IE it should not be seen.
Posted 12 Mar, 2013 06:57:13 Top
Sergey Grischenko


Add-in Express team


Posts: 7233
Joined: 2004-07-05
Posted 12 Mar, 2013 10:38:50 Top
ravinukala




Posts: 103
Joined: 2012-10-05
Hi

We have evaluated web browser control and that has its own other issues. So that is not an option.
Posted 12 Mar, 2013 23:53:42 Top