0

I'm looking for a way to activate one of my running application in taskbar of windows only. Situation:

  • I'm having 10 identical application windows up and running
  • I'm having a JTable with 10 rows for those windows, I want to select a windows in correct position according to the row I'm selecting in JTable ( like select first window for the first rows, etc.....). How to achieve this?

I can get their processId but I don't know what to do with it. I'm also using robot class for this but seems like it's not so ideal. The approach may not necessary be in Java, any idea will help. Thanks in advance

  • this may help you....https://stackoverflow.com/questions/35956816/how-to-get-opened-applications-list-in-windowstaskmanager-application-using – Vijaya Varma Lanke Oct 04 '19 at 08:46
  • Thanks for that, but seems like not what I'm looking for. I can get the processes back but I need to select/activate them to show in foreground too. – Hieu Nguyen Oct 04 '19 at 08:53
  • Since you say you're open to other languages : https://stackoverflow.com/questions/4993926/maximize-window-and-bring-it-in-front-with-powershell – Aaron Oct 04 '19 at 09:59
  • Thanks for that Aaron, but my windows are having the same name, how to distinguish them to use the method in that link? – Hieu Nguyen Oct 05 '19 at 06:16
  • Sorry, I hadn't seen your comment (use @name to answer to someone, only the question or answer's writer are automatically notified of comments). I don't know powershell much, but I'm sure you could use it to start the program, retrieve the associated PID and use the `Set-ForegroundWindow (Get-Process -id $pid).MainWindowHandle` syntax the linked solution suggests. – Aaron Oct 15 '19 at 13:34

0 Answers0