This Question is Assumed Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
3 Replies Last post: Jan 22, 2010 8:06 PM by cobblestone  
cobblestone   20 posts since
Jan 15, 2010
Currently Being Moderated

Jan 21, 2010 10:40 PM

Can I get an IE browser with every thing (address bar, menubar, etc.)?

I ran the comfyj demo and samples and saw the embedded IE browser is a headless one, that is, no title, no address bar, no toolbar, and no status bar, etc.. I was wondering if I can create an complete IE browser with every thing using some thing like,

 

    OleContainer.createObject("Shell.Explorer");

 

Thanks,

 

Cobble S.

Serge Piletsky TeamDev Ltd. 1,066 posts since
Apr 24, 2006
Currently Being Moderated
2. Jan 22, 2010 4:05 PM in response to: cobblestone
Re: Can I get an IE browser with every thing (address bar, menubar, etc.)?

Hi Cobble,

 

Even though these properties are available in the API of WebBrowser ActiveX component, on practice we have never seen that they could be enabled if a WebBrowser component is being used as an embedded component outside IE application.

 

But if you run IE without embedding as a separate application then changing of these properties will work. The example below demonstrates it:

public static void main(String[] args) throws Exception {
    ComFunctions.coInitialize();
 
    final CLSID CLSID_InternetExplorer = new CLSID("{0002DF01-0000-0000-C000-000000000046}");
 
    IDispatchImpl webBrowser = new IDispatchImpl(CLSID_InternetExplorer, ClsCtx.LOCAL_SERVER);
 
    final boolean useCurrentThread = true;
    Automation webBrowserAutomation = new Automation(webBrowser, useCurrentThread);
 
    webBrowserAutomation.setProperty("Visible", Boolean.TRUE);
 
    webBrowserAutomation.setProperty("AddressBar", VariantBool.TRUE);
    webBrowserAutomation.setProperty("ToolBar", VariantBool.FALSE);
    webBrowserAutomation.setProperty("MenuBar", VariantBool.FALSE);
    webBrowserAutomation.setProperty("StatusBar", VariantBool.FALSE);
 
    webBrowserAutomation.invoke("Navigate2", "http://www.teamdev.com");
 
    System.out.println("Press 'Enter' to terminate application");
    System.in.read();
 
    webBrowserAutomation.invoke("Quit");
 
    webBrowserAutomation.release();
 
    webBrowser.setAutoDelete(false);
    webBrowser.release();
 
    System.out.println("Done");
}

 

Please let me know if you have any further questions.

 

-Serge

More Like This

  • Retrieving data ...