Ejemplo n.º 1
0
 public static Integer getProcessID(Process p) {
   try {
     Field f = p.getClass().getDeclaredField("pid");
     f.setAccessible(true);
     Integer s = (Integer) f.get(p);
     return s;
   } catch (NoSuchFieldException e) {
     e.printStackTrace();
   } catch (SecurityException e) {
     e.printStackTrace();
   } catch (IllegalArgumentException e) {
     e.printStackTrace();
   } catch (IllegalAccessException e) {
     e.printStackTrace();
   }
   return null;
 }