Name of process for active window in Windows 8/10

前端 未结 4 1051
南方客
南方客 2020-12-02 15:06

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

4条回答
  •  再見小時候
    2020-12-02 15:15

    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?

提交回复
热议问题