Examples of RegistryKey


Examples of ca.beq.util.win32.registry.RegistryKey

    if (System.getProperty("os.name").toLowerCase().startsWith("windows") && !TVBrowser.isTransportable()) {
      layout.insertRow(++y, RowSpec.decode("1dlu"));
      layout.insertRow(++y, RowSpec.decode("pref"));

      try {
        RegistryKey shellFolders = new RegistryKey(RootKey.HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders");
        String path = shellFolders.getValue("Startup").getData().toString();

        if(path == null || path.length() < 1 || !(new File(path)).isDirectory()) {
          throw new Exception();
        }
View Full Code Here

Examples of ca.beq.util.win32.registry.RegistryKey

import ca.beq.util.win32.registry.RootKey;

public abstract class GameAdapterWithRegistryAutoDetection extends GameAdapter implements IGameWithRegistryAutoDetection {
  protected RegistryKey autoDetectGetRegistryKey(String registryKey) {
    try {
      RegistryKey r = new RegistryKey(RootKey.HKEY_LOCAL_MACHINE, registryKey);
      return r;
    } catch(RegistryException e) {
      try {
        RegistryKey r = new RegistryKey(RootKey.HKEY_CURRENT_USER, registryKey);
        return r;
      } catch(RegistryException ex) {
        // Not found
      }
    }
View Full Code Here

Examples of ca.beq.util.win32.registry.RegistryKey

    }
    return null;
  }
  protected String autoDetectGetRegistryKeyValue(String registryKey,String registryValue) {
    try {
      RegistryKey r = autoDetectGetRegistryKey(registryKey);
      if(r.hasValue(registryValue)) {
        RegistryValue v = r.getValue(registryValue);
        return (String)v.getData();
      }
    } catch (RegistryException e) {
      // Not found
    }
View Full Code Here

Examples of ca.beq.util.win32.registry.RegistryKey

      System.out.println(" - '" + c + "'");
    }
    */
    System.out.println("...");
    //RegistryKey r = new RegistryKey(RootKey.HKEY_CURRENT_USER, "Software\\US Army\\America's Army\\Operations");
    RegistryKey r = new RegistryKey(RootKey.HKEY_LOCAL_MACHINE, "Software\\US Army\\America's Army\\Operations");
    if(r.hasValue("InstallDir")) {
       RegistryValue v = r.getValue("InstallDir");
       System.out.println(v.toString() + " ... " + v.getData());
    }
    if(r.hasSubkeys()) {
       Iterator i = r.subkeys();
       while(i.hasNext()) {
          RegistryKey x = (RegistryKey)i.next();
          System.out.println(x.toString());
       } // while
    } // if
  }
View Full Code Here

Examples of ca.beq.util.win32.registry.RegistryKey

          public void run() {
            ChannelList.completeChannelLoading();
            initializeAutomaticDownload();
            if (Launch.isOsWindowsNtBranch()) {
              try {
                RegistryKey desktopSettings = new RegistryKey(
                    RootKey.HKEY_CURRENT_USER, "Control Panel\\Desktop");
                RegistryValue autoEnd = desktopSettings
                    .getValue("AutoEndTasks");

                if (autoEnd.getData().equals("1")) {
                  RegistryValue killWait = desktopSettings
                      .getValue("WaitToKillAppTimeout");

                  int i = Integer.parseInt(killWait.getData().toString());

                  if (i < 5000) {
                    JOptionPane pane = new JOptionPane();

                    String cancel = mLocalizer.msg("registryCancel",
                        "Close TV-Browser");
                    String dontDoIt = mLocalizer.msg("registryJumpOver",
                        "Not this time");

                    pane.setOptions(new String[] {
                        Localizer.getLocalization(Localizer.I18N_OK), dontDoIt,
                        cancel });
                    pane.setOptionType(JOptionPane.YES_NO_CANCEL_OPTION);
                    pane.setMessageType(JOptionPane.WARNING_MESSAGE);
                    pane
                        .setMessage(mLocalizer
                            .msg(
                                "registryWarning",
                                "The fast shutdown of Windows is activated.\nThe timeout to wait for before Windows is closing an application is too short,\nto give TV-Browser enough time to save all settings.\n\nThe setting hasn't the default value. It was changed by a tool or by you.\nTV-Browser will now try to change the timeout.\n\nIf you don't want to change this timeout select 'Not this time' or 'Close TV-Browser'."));

                    pane.setInitialValue(mLocalizer.msg("registryCancel",
                        "Close TV-Browser"));

                    JDialog d = pane.createDialog(UiUtilities
                        .getLastModalChildOf(mainFrame), UIManager
                        .getString("OptionPane.messageDialogTitle"));
                    d.setModal(true);
                    UiUtilities.centerAndShow(d);

                    if (pane.getValue() == null
                        || pane.getValue().equals(cancel)) {
                      mainFrame.quit();
                    } else if (!pane.getValue().equals(dontDoIt)) {
                      try {
                        killWait.setData("5000");
                        desktopSettings.setValue(killWait);
                        JOptionPane
                            .showMessageDialog(
                                UiUtilities.getLastModalChildOf(mainFrame),
                                mLocalizer
                                    .msg("registryChanged",
View Full Code Here

Examples of ca.beq.util.win32.registry.RegistryKey

        if (RunAnywhere.isWindows()) {
            try {
                String host = null, port = null;
                boolean enabled = false;
                RegistryKey.initialize();
                RegistryKey r = new RegistryKey(RootKey.HKEY_CURRENT_USER, PROXY_REGISTRY);
                for (Iterator<?> iter = r.values(); iter.hasNext(); ) {
                    RegistryValue value = (RegistryValue)iter.next();
                    if (value.getName().equals("ProxyEnable")) {
                        enabled = value.getStringValue().equals("1");
                    }
                    if (value.getName().equals("ProxyServer")) {
View Full Code Here

Examples of com.ice.jni.registry.RegistryKey

            Registry.HKEY_CURRENT_USER, Registry.HKEY_LOCAL_MACHINE };
        for (int i = 0, n = possibleKeys.length; i < n; i++) {
          if (officeProgressMonitor != null)
            officeProgressMonitor.beginSubTask(Messages.getString("ApplicationAssistant.monitor_scanning_key", possibleKeys[i])); //$NON-NLS-1$
          for (int j = 0; j < ROOTS.length; j++) {
            RegistryKey registryKey = Registry.openSubkey(ROOTS[j],
                possibleKeys[i],
                RegistryKey.ACCESS_READ);
            if (registryKey != null) {
              String path = null;
              if (path == null) {
                try {
                  path = registryKey.getStringValue("Path");
                  path = "\"" + path
                      + "\"";
                }
                catch (NoSuchValueException noSuchValueException) {
                  //ignore
                }
              }
              if (path == null) {
                try {
                  path = registryKey.getDefaultValue();
                }
                catch (NoSuchValueException noSuchValueException) {
                  //ignore
                }
              }
View Full Code Here

Examples of com.ice.jni.registry.RegistryKey

            officeProgressMonitor
                .beginSubTask(Messages
                    .getString(
                        "ApplicationAssistant.monitor_scanning_key", possibleKeys[i])); //$NON-NLS-1$
          for (int j = 0; j < ROOTS.length; j++) {
            RegistryKey registryKey = Registry.openSubkey(ROOTS[j],
                possibleKeys[i], RegistryKey.ACCESS_READ);
            if (registryKey != null) {
              String path = null;
              if (path == null) {
                try {
                  path = registryKey.getStringValue("Path");
                  path = "\"" + path + "\"";
                } catch (NoSuchValueException noSuchValueException) {
                  // ignore
                }
              }
              if (path == null) {
                try {
                  path = registryKey.getDefaultValue();
                } catch (NoSuchValueException noSuchValueException) {
                  // ignore
                }
              }
              if (path != null) {
View Full Code Here

Examples of org.boris.winrun4j.RegistryKey

        EventLog.report("WinRun4J Test", EventLog.INFORMATION,
                "A test information log");

        // Test registry
        sb.append("\n\nRegistry Test\n=============\n\n");
        RegistryKey key = new RegistryKey(RegistryKey.HKEY_CURRENT_USER,
                "Control Panel\\Appearance\\Schemes");
        key.open();
        String[] names = key.getValueNames();
        for (int i = 0; i < names.length && i < 5; i++) {
            sb.append(names[i]);
            sb.append("\n");
        }
        key.close();

        text.setText(sb.toString());
        frame.getContentPane().add(new JScrollPane(text));
        frame.setSize(500, 500);
        frame.setLocation(30, 30);
View Full Code Here

Examples of org.hyperic.sigar.win32.RegistryKey

     *
     * @throws SystemInfoException
     */
    public List<String> getRegistryChildKeys(Root root, String key) throws SystemInfoException {
        try {
            RegistryKey registry = null;

            switch (root) {
            case HKEY_CURRENT_USER: {
                registry = RegistryKey.CurrentUser.openSubKey(key);
                break;
            }

            case HKEY_LOCAL_MACHINE: {
                registry = RegistryKey.LocalMachine.openSubKey(key);
                break;
            }

            default: {
                throw new SystemInfoException("Invalid root: " + root);
            }
            }

            List<String> list = new ArrayList<String>();

            String[] values = registry.getSubKeyNames();
            if (values != null) {
                list.addAll(Arrays.asList(values));
            }

            return list;
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.