1

how can we make a java program which enlist all the running/opened applications on a windows machine , i have the requirement to keep switching among the application dynamically.

Is there any java API for window threads ???

1 Answers1

2

This might help you

public static void main(String[] asss){
        try{
        String line;
        Process p = Runtime.getRuntime().exec(
                System.getenv("windir") + "/system32/" + "tasklist.exe");

        BufferedReader input = new BufferedReader(new InputStreamReader(
                p.getInputStream()));
        while ((line = input.readLine()) != null) {         
                System.out.println(line);
        }
        input.close();
        }catch(Exception e){
            e.printStackTrace();
        }


    }
NoNaMe
  • 6,020
  • 30
  • 82
  • 110