We want to open a window with no menubar, linkbar etc. How can we do?

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

We want to open a window with no menubar, linkbar etc. How can we do?
 
Jagdish Yadav




Posts: 22
Joined: 2009-03-25
We are using the following code to open a IE window on click of a command button. This opens up a new window with menubar, titlebar, etc.

We want to open a window with no menubar, linkbar etc. How can we do it?


string PostDataStr = "url=" + documentUrl + "&title=" + documentTitle + "&teaser=" + documentSelectedText;
byte[] PostDataByte = System.Text.Encoding.UTF8.GetBytes(PostDataStr);
string AdditionalHeaders = "Content-Type: application/x-www-form-urlencoded" + Environment.NewLine;

System.Object one = "_SELF";
System.Object two = "new";
System.Object three = PostDataByte;
System.Object four = AdditionalHeaders;

IEApp.Navigate(navigateURL, ref one, ref two, ref three, ref four);
Posted 08 Oct, 2009 02:23:56 Top
Andrei Smolin


Add-in Express team


Posts: 15821
Joined: 2006-05-11
Hello Jagdish,

Please check http://msdn.microsoft.com/en-us/library/ms536651(VS.85).aspx.

Regards from Belarus (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 08 Oct, 2009 03:19:51 Top
Jagdish Yadav




Posts: 22
Joined: 2009-03-25
I am using byte[] PostDataByte to send encoded data as the data can be in japanese also.

window.open does not have any paramater for sending such data.
Posted 09 Oct, 2009 07:27:35 Top
Sergey Grischenko


Add-in Express team


Posts: 7215
Joined: 2004-07-05
Hi Jagdish.

You can use the MSHTML object model to make any changes in the new opened window.
Posted 12 Oct, 2009 05:44:56 Top
Jagdish Yadav




Posts: 22
Joined: 2009-03-25
Thanks.
Please, can you share us a sample code.
Posted 15 Oct, 2009 01:38:04 Top
Sergey Grischenko


Add-in Express team


Posts: 7215
Joined: 2004-07-05
Hi Jagdish.

mshtml.IHTMLWindow2 window = HTMLDocument.parentWindow;
mshtml.IHTMLWindow2 newWindow =
window.open("//www.add-in-express.com", null, "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no", true);

Then you can change the title in the DocumentComplete event handler of the iemodule:

private void IEModule_DocumentComplete(object pDisp, string url)
{
if (!IEApp.MenuBar)
{
HTMLDocument.title = "My Title";
}
}
Posted 15 Oct, 2009 06:57:16 Top
Jagdish Yadav




Posts: 22
Joined: 2009-03-25
Hi Sergey,

You are using window.open. But window.open does not support passing UTF8 encoded byte[] format data.

We want to pass in the format given below. Please look at variable three.

System.Object one = "_SELF";
System.Object two = "new";
System.Object three = PostDataByte; //This is byte data
System.Object four = AdditionalHeaders;
IEApp.Navigate(navigateURL, ref one, ref two, ref three, ref four);

Along with this I want to hide the MenuBar, StatusBar, etc

How is this possible using mshtml object?
Posted 15 Oct, 2009 07:40:17 Top
Sergey Grischenko


Add-in Express team


Posts: 7215
Joined: 2004-07-05
Jagdish, all that you need is passed in the 'features' parameter of the window.open method.
Posted 15 Oct, 2009 08:16:46 Top
Jagdish Yadav




Posts: 22
Joined: 2009-03-25
Right, But how do you pass the encoded byte[] data in window.open? i need to 'post' japanese data to the window that I am opening. How can we post japanese data with window.open().

Secondly If I use window.open, I keep getting 'pop up blocked'. This is a problem as I can click the add-on button to open the pop up from any URL.

So, the only solution I feel is somewhere in the first post that I wrote. The only problem area is passing the window 'features'

Posted 15 Oct, 2009 23:13:03 Top
Sergey Grischenko


Add-in Express team


Posts: 7215
Joined: 2004-07-05
Jagdish, I don't pass any data. I just use the 'features' parameter to configure the window. Now I don't have any other solution. I will let you know if I find any.
Posted 16 Oct, 2009 04:10:25 Top