PowerToys/tools/HandlesExperiment/FileLocksmithConsoleUI/main.cpp

25 lines
493 B
C++
Raw Normal View History

2022-09-13 21:03:07 +08:00
#include "pch.h"
#include <iostream>
int wmain(int argc, WCHAR** argv)
{
2022-09-13 21:58:36 +08:00
auto paths_to_check = ipc::read_paths_from_stdin();
auto result = find_processes_nonrecursive(paths_to_check);
2022-09-13 21:58:36 +08:00
if (result.empty())
{
std::wcout << L"No processes are using these files.\n";
}
else
{
for (auto process_info : result)
{
std::wcout << L"[" << process_info.pid << L"] " << process_info.name << L'\n';
}
}
2022-09-14 16:45:14 +08:00
Sleep(INFINITE);
2022-09-13 21:58:36 +08:00
}