Call function once window open

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

Call function once window open
 
princy rose




Posts: 10
Joined: 2010-09-14
Hello,

I need to call the function once when opening browser only. I have used the following code to open the ShowDialog Box. But it opens every time when i click the new tab and child window if any. So for this, in which event i can call this function.


My code:

private void MyIEToolBar1_OnConnect(object sender, int threadId)
{
this.SendMessage(0x400 + 1000, IntPtr.Zero, IntPtr.Zero);
}


private void MyIEToolBar1_OnSendMessage(AddinExpress.IE.ADXIESendMessageEventArgs e){
if (e.Message == 0x400 + 1000) {
Form form1 = new Form();
form1.ShowDialog();

if (form1.DialogResult == DialogResult.OK) {
System.Object one = null;
System.Object two = null;
System.Object three = null;
System.Object four = null;
IEApp.Navigate(@"//www.add-in-express.com", ref one, ref two, ref three, ref four);
form1.Dispose();
} else {
form1.Dispose();
}
Posted 24 Sep, 2010 05:26:49 Top
Andrei Smolin


Add-in Express team


Posts: 18830
Joined: 2006-05-11
Hi princy,

That event occura whenever a new tab is opened. To bypass this, you can use a global flag. Pay attention to http://www.add-in-express.com/creating-addins-blog/2009/06/19/internet-explorer-plugin-settings-synchronize/.


Andrei Smolin
Add-in Express Team Leader
Posted 24 Sep, 2010 05:52:23 Top