I have created a browser using the WebBrowser control. Many links & buttons in web pages are programmed to open in new smaller browser windows (like the Manage Attachments button in this forum on the page where one has to type his question). Ofetn the Max button on the title bar of such windows is disabled.

To open the new smaller window, I am using the WebBrowser's ClientToHostWindow event to retrieve the width & the height in which the new browser window is programmed to open. I would also like to disable the Max button of such browser windows but when I use the code

Code:
Me.MaxButton = False
in the WebBrowser's ClientToHostWindow event, then VB generates the following error:

Compile error:

Function or interface marked as restricted, or the function uses an Automation type not supported in Visual Basic


which points to .MaxButton in the above code.

How do I overcome this error & disable the Max button of such browser windows?