Hi,
I am trying to open an IE window from my code using the following:
private void Form1_Load(object sender, EventArgs e)
{
object sObj = null;
m_IExplorer = new SHDocVw.InternetExplorerClass();
m_WebBrowser = (IWebBrowserApp)m_IExplorer;
object sUrl = "www.google.com";
m_WebBrowser.Navigate((string)sUrl, ref sObj, ref sObj, ref sObj, ref sObj);
m_WebBrowser.Visible = false;
int mainHandle = m_IExplorer.HWND;
}
and then in a button click I am opening a new window like this:
private void button1_Click(object sender, EventArgs e)
{
object flag = 0x1;
object sObj = null;
object sUrl = "http://www.yahoo.com";
m_WebBrowser.Navigate((string)sUrl, ref flag, ref sObj, ref sObj, ref sObj);
m_WebBrowser.Visible = true;
int childHandle = m_IExplorer.HWND;
}
So here, at the form load my main window, I intend to have it invisible and only make the child window visible. But what happens is, at the button click when the child window is made visible, both the main and the child window becomes invisible.
What I would like to know is how do I get the handle on the new window that is created and just try to make that visible and keep the main window visible property as false.
Thanks for your help,
-Bhaskar.