Example Code

function IsMetroUIProcess(const hProcess: THandle): BOOL; stdcall; // Determines whether or not the target process is a Windows 8+ Metro/WinRT app // *Note* Metro apps can ONLY load DLLs with the "ALL APPLICATION PACKAGES" group ACL granted // If you want to avoid adding this ACL yourself programmatically you can also exercise the // option of placing your DLL file in the WINDOWS or system32 directories, both of which directories // will cause your copied DLL file to inherit these required Metro app file permissions automatically // By default this new group allows only Read and Execute / Read access var hProcess: THandle; dwProcessId: DWORD; sPID: String; begin sPID := InputBox('Enter Process ID', 'Process ID', ''); Val(sPID, dwProcessId, dwProcessId); hProcess := OpenProcessMax(dwProcessId); if (hProcess <> 0) then begin if IsMetroUIProcess(hProcess) then ShowMessage('Metro UI process') else ShowMessage('Regular process'); CloseHandle(hProcess); end; end;