Examples of OleAutomation


Examples of org.eclipse.swt.ole.win32.OleAutomation

  private static class CMN_getOleProperty extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      String[] propertyPath = (String[])args[0];
      OleAutomation automation = new OleAutomation(getSite((OleFrame)getControl()));
      int[] ids;
      for(int i=0; i<propertyPath.length; i++) {
        ids = automation.getIDsOfNames(new String[] {propertyPath[i]});
        if(ids == null) {
          automation.dispose();
          return null;
        }
        if(i == propertyPath.length - 1) {
          Object[] vargs = (Object[])args[1];
          Variant[] params = new Variant[vargs.length];
          for(int j=0; j<vargs.length; j++) {
            params[j] = createVariant(vargs[j]);
          }
          Variant propertyVariant = automation.getProperty(ids[0], params);
          for(Variant param: params) {
            dispose(param);
          }
          Object result = getVariantValue(propertyVariant);
          dispose(propertyVariant);
          automation.dispose();
          return result;
        }
        Variant variantProperty = automation.getProperty(ids[0]);
        OleAutomation newAutomation = variantProperty.getAutomation();
        variantProperty.dispose();
        automation.dispose();
        automation = newAutomation;
      }
      automation.dispose();
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

          sb.append("  ");
        }
        sb.append(propertyName).append(Utils.LINE_SEPARATOR);
        Variant variantProperty = automation.getProperty(automation.getIDsOfNames(new String[] {propertyName})[0]);
        if(variantProperty != null && variantProperty.getType() == OLE.VT_DISPATCH) {
          OleAutomation newAutomation = variantProperty.getAutomation();
          dumpOleInterfaceDefinitions(sb, newAutomation, index + 1);
          newAutomation.dispose();
        }
        dispose(variantProperty);
      }
    }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

        if(value != null) {
          String fieldDescription = fieldName.substring("VT_".length()).toLowerCase(Locale.ENGLISH);
          oleTypeToDescriptionMap.put(value, fieldDescription);
        }
      }
      OleAutomation automation = new OleAutomation(getSite((OleFrame)getControl()));
      StringBuilder sb = new StringBuilder();
      dumpOleInterfaceDefinitions(sb, automation, 0);
      automation.dispose();
      System.out.print(sb.toString());
      return null;
    }
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

    OleControlSite site;
    try {
      site = new OleControlSite(frame, SWT.NONE, "Shell.Explorer");
      configureOleFrame(site, frame);
      // Add a listener
      OleAutomation shellExplorer = new OleAutomation(site);
      int[] dispIDs = shellExplorer.getIDsOfNames(new String[] {"Application"});
      Variant pVarResult = shellExplorer.getProperty(dispIDs[0]);
      final OleAutomation application = pVarResult.getAutomation();
      frame.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          application.dispose();
        }
      });
      pVarResult.dispose();
      shellExplorer.dispose();
      OleListener listener = new OleListener() {
View Full Code Here

Examples of org.eclipse.swt.ole.win32.OleAutomation

          webBrowserField.setAccessible(true);
          Object swtWebBrowser = webBrowserField.get(browser);
          if(ieClass.isInstance(swtWebBrowser)) {
            Field autoField = ieClass.getDeclaredField("auto");
            autoField.setAccessible(true);
            OleAutomation swtBrowserAutomation = (org.eclipse.swt.ole.win32.OleAutomation)autoField.get(swtWebBrowser);
            int[] rgdispid = swtBrowserAutomation.getIDsOfNames(new String[] { "ExecWB", "cmdID", "cmdexecopt" });
            Variant[] rgvarg = new Variant[] {
                new Variant(OLE.OLECMDID_PRINT),
                new Variant(isShowingDialog? OLE.OLECMDEXECOPT_PROMPTUSER : OLE.OLECMDEXECOPT_DONTPROMPTUSER),
            };
            int[] rgdispidNamedArgs = new int[] {
                rgdispid[1],
                rgdispid[2],
            };
            /*Variant pVarResult =*/ swtBrowserAutomation.invoke(rgdispid[0], rgvarg, rgdispidNamedArgs);
            // isn't there any possible error handling?
            return true;
          }
        } catch (Throwable t) {
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.