Package ca.beq.util.win32.registry

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


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

    }
    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

      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

          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

        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

  }
  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
    }
    return null;
View Full Code Here

    */
    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();
View Full Code Here

            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
View Full Code Here

                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")) {
                        String strval = value.getStringValue();
                        int cidx = strval.indexOf(":");
                        if (cidx != -1) {
                            port = strval.substring(cidx+1);
                            strval = strval.substring(0, cidx);
                        }
View Full Code Here

TOP

Related Classes of ca.beq.util.win32.registry.RegistryKey

Copyright © 2018 www.massapicom. 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.