0

Can Java check what program is currently focused (used?) and tell you what the name of the program is?

Here's an example of what I mean:

User is using Chrome

Program: "Currently focused: 'chrome.exe'

It doesn't nessecarily have to name the name of the exe file, the title of the window is fine as well.

Is this possible? if so, how would I go about making this?

Community
  • 1
  • 1
Yen
  • 25
  • 5

1 Answers1

0

It seems you will probably need to use JNA (or something similar). Have a look at

Windows: how to get a list of all visible windows?

and

How to get list of all window handles in Java (Using JNA)?

Community
  • 1
  • 1
honerlawd
  • 1,499
  • 11
  • 10