Getting active window information in Java
Save yourself some pain and use JNA. You will need to download jna.jar and jna-platform.jar for the Win32 API. The pinvoke wiki and MSDN are useful for finding the right system calls. Anyway, here is the code to print the title and process of the currently active window. import static enumeration.EnumerateWindows.Kernel32.*; import static enumeration.EnumerateWindows.Psapi.*; import … Read more