[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.platform.swt] Windows Application embedding in a SWT composite
|
- From: Giacomo Borri <g.borri@xxxxxxxxxxx>
- Date: Sun, 15 Oct 2006 15:46:52 +0200
- Newsgroups: eclipse.platform.swt
- Organization: EclipseCorner
- User-agent: Mozilla Thunderbird 1.5.0.7 (Windows/20060909)
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]});
---------------------------------------------------