SWT Ole Frame : WIN32 « SWT JFace Eclipse « Java

Home
Java
1.2D Graphics GUI
2.3D
3.Advanced Graphics
4.Ant
5.Apache Common
6.Chart
7.Class
8.Collections Data Structure
9.Data Type
10.Database SQL JDBC
11.Design Pattern
12.Development Class
13.EJB3
14.Email
15.Event
16.File Input Output
17.Game
18.Generics
19.GWT
20.Hibernate
21.I18N
22.J2EE
23.J2ME
24.JavaFX
25.JDK 6
26.JDK 7
27.JNDI LDAP
28.JPA
29.JSP
30.JSTL
31.Language Basics
32.Network Protocol
33.PDF RTF
34.Reflection
35.Regular Expressions
36.Scripting
37.Security
38.Servlets
39.Spring
40.Swing Components
41.Swing JFC
42.SWT JFace Eclipse
43.Threads
44.Tiny Application
45.Velocity
46.Web Services SOA
47.XML
Java » SWT JFace Eclipse » WIN32 




SWT Ole Frame
SWT Ole Frame


import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.ole.win32.OLE;
import org.eclipse.swt.ole.win32.OleAutomation;
import org.eclipse.swt.ole.win32.OleControlSite;
import org.eclipse.swt.ole.win32.OleFrame;
import org.eclipse.swt.ole.win32.Variant;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

public class SWTOleFrame {

  public static void main(String[] args) {

    final Display display = new Display();
    Shell shell = new Shell(display);
    shell.setSize(600400);
    shell.setLayout(new FillLayout());

    OleControlSite oleControlSite;

    OleFrame oleFrame = new OleFrame(shell, SWT.NONE);
    oleControlSite = new OleControlSite(oleFrame, SWT.NONE,
        "Shell.Explorer");
    oleControlSite.doVerb(OLE.OLEIVERB_INPLACEACTIVATE);
    shell.open();

    final OleAutomation browser = new OleAutomation(oleControlSite);

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

    while (!shell.isDisposed()) {
      if (!display.readAndDispatch())
        display.sleep();
    }

    browser.dispose();
    display.dispose();
  }
}



           
       














Related examples in the same category
1.Invoke the system text editor on autoexec.bat
2.Place an icon with a popup menu on the system trayPlace an icon with a popup menu on the system tray
3.OLE and ActiveX example snippet
4.Word OLEWord OLE
5.Invoke an external batch fileInvoke an external batch file
6.Find the icon of the program that edits .bmp filesFind the icon of the program that edits .bmp files
7.Running a script within IE.Running a script within IE.
8.Reading and writing to a SAFEARRAY
9.Embed Word in an applet
10.OLE and ActiveX example: browse the typelibinfo for a program id
11.OLE and ActiveX example: get events from IE controlOLE and ActiveX example: get events from IE control
12.How to access About, Preferences and Quit menus on carbon
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.