The following sample has reliably returned the name of the process that is associated with the active window, but does not work with the newer modern/universal apps because
Does taking snapshot of running processes and pulling the name out of it by comparing process id not work? Full reference here:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686837(v=vs.85).aspx
But you fix the snapshot with CreateToolhelp32Snapshot().
Or from WTSEnumerateProcesses() and surrounding API?
Pretty sure it worked in Win 8. Is it broken in 10?