Prevent hook helper from running when in UWP mode

This commit is contained in:
Paddy Xu
2017-07-11 23:43:16 +03:00
parent 031803a40e
commit d855e80bdc
5 changed files with 20 additions and 0 deletions

View File

@@ -71,3 +71,14 @@ bool HelperMethods::IsCursorActivated(HWND hwnd)
GetGUIThreadInfo(tId, &gui);
return gui.flags || gui.hwndCaret;
}
bool HelperMethods::IsUWP()
{
auto pGCPFN = decltype(&GetCurrentPackageFullName)(GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetCurrentPackageFullName"));
if (!pGCPFN)
return false;
UINT32 pn = 0;
return pGCPFN(&pn, nullptr) == ERROR_INSUFFICIENT_BUFFER;
}