0

I am monitoring the current foreground process using SetWinEventHook() and EVENT_SYSTEM_FOREGROUND, which gives me the HWND of the window that is currently in the foreground.

I've noticed that UWP Apps are just ApplicationFrameHost.exe processes and the foreground HWND points to an ApplicationFrameHost window. Per another StackOverflow post, to find the actual HWND of the app window, I am supposed to find the first child window of that window that does not belong to the same process, then do my processing there. My processing is just finding the AUMID.

Is there any way to get the app window HWND, or the AUMID, as soon as the ApplicationFrameHost is launched, instead of waiting for the app window to be fully initialized?

  • Your link is missing a URL. – IInspectable May 30 '20 at 06:51
  • Ok, so I've sort of figured it out now but I want to check whether it is secure. It is possible to use `SHGetPropertyStoreForWindow` to get the property store then get the `System.AppUserModel.ID` property to get the AUMID. However, can this value be modified by the UWP app or any external actor to some other value that does not reflect the UWP app's real AUMID (as set in it's manifest file)? – Enigmatrix Atheros May 30 '20 at 12:17

0 Answers0