[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: Windows Application embedding in a SWT composite

For much precision:

This code will open two windows of Internet Explorer in a composite:

----------------------------------------------

....


protected void initialize() { OleControlSite oleControlSite = null; this.setLayout(new FillLayout()); OleFrame oleFrame = new OleFrame(this,SWT.NONE); oleControlSite = new OleControlSite(oleFrame,SWT.NONE,"Shell.Explorer"); oleControlSite.setLayout(new FillLayout()); oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE); oleFrame.setFocus(); oleFrame.pack(); OleAutomation browser = new OleAutomation(oleControlSite); int[] browserIDs = browser.getIDsOfNames(new String[]{"Navigate","URL"}); Variant[] address = new Variant[] {new Variant("http://www.google.it";)}; browser.invoke(browserIDs[0],address,new int[]{browserIDs[1]}); }

--------------------------------------------------------

Is it a bug????


Giacomo Borri ha scritto:
Hi,
someone knows how to embed a Windows application in a Eclipse RCP Application?


I need to embed some windows application (Internet Explorer (with status bar, address bar, ecc.), Acrobat Reader, 3270 Emulator and some other applications) in a SWT Composite?

For example tried this snippet for Internet Explorer but the result was not good ... Two small boxes appear in the composite and in every box there is the main page of google.

How to dimension correctly the browser?
How to show the status bar, ecc?

Any suggestion?

Thanks

---------------------------------------------------

GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.grabExcessHorizontalSpace = true;
gridData.grabExcessVerticalSpace = true;
gridData.verticalAlignment = GridData.FILL;
GridLayout gridLayout1 = new GridLayout();
gridLayout1.horizontalSpacing = 0;
gridLayout1.marginWidth = 0;
gridLayout1.marginHeight = 0;
gridLayout1.numColumns = 1;
gridLayout1.verticalSpacing = 0;
composite = new Composite(this, SWT.EMBEDDED);
composite.setLayout(gridLayout1);
composite.setSize(640, 480);
composite.setLayoutData(gridData);
OleControlSite oleControlSite = null;
OleFrame oleFrame = new OleFrame(composite,SWT.NONE);
oleFrame.setSize(640, 480);
oleControlSite = new OleControlSite(oleFrame,SWT.NONE,"Shell.Explorer");
oleControlSite.doVerb(OLE.OLEIVERB_UIACTIVATE);


        composite.setFocus();

        oleFrame.pack();
        composite.pack();

OleAutomation browser = new OleAutomation(oleControlSite);
int[] browserIDs = browser.getIDsOfNames(new String[]{"Navigate","URL"});
Variant[] address = new Variant[] {new Variant("http://www.google.com";)};
browser.invoke(browserIDs[0],address,new int[]{browserIDs[1]});
---------------------------------------------------