Click here to Skip to main content
15,907,326 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I have an IE add-on which which is created in windows form through c#. I am calling an iframe in this add-on. Now I want to pass the current URL and title of IE to this iframe through postmessage(value of label1.Text and label2.Text) , I did the following code but it not passing URL :
private void Login_Load(object sender, EventArgs e)
{
foreach (InternetExplorer ie in new ShellWindows())
{
label1.Text = ie.LocationURL.ToString();
label2.Text = ie.LocationName.ToString();
}
string _embeddedpage = @"
<!doctype html>
<html>
<head></head>
<body>
<iframe width='100%' height='420' src='http://dev.livestuff.com/BrowserAddon?previewmode=Y' frameborder='0'></iframe>
</body>
</html>";

webBrowser1.DocumentText = _embeddedpage;
}
[DllImport("user32.dll", SetLastError = true)]
static extern bool PostMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);

Please suggest any code for Posmessage.
Thanks
Posted
Updated 16-Apr-14 20:52pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900