Skip to content

Instantly share code, notes, and snippets.

View goias5's full-sized avatar

Fernando Henrique Coimbra Afonso goias5

  • Goiânia, Goiás, Brasil
View GitHub Profile
@vladholubiev
vladholubiev / getActiveWindow.java
Created June 30, 2014 22:00
Get current active windows title and process using JNA
import static enumeration.EnumerateWindows.Kernel32.*;
import static enumeration.EnumerateWindows.Psapi.*;
import static enumeration.EnumerateWindows.User32DLL.*;
import com.sun.jna.Native;
import com.sun.jna.Pointer;
import com.sun.jna.platform.win32.WinDef.HWND;
import com.sun.jna.ptr.PointerByReference;
public class EnumerateWindows {
private static final int MAX_TITLE_LENGTH = 1024;