mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Remove retries (#12860)
This commit is contained in:
@@ -42,9 +42,6 @@ inline std::wstring get_process_path(HWND window) noexcept
|
|||||||
// It might take a time to connect the process. That's the reason for the retry loop here
|
// It might take a time to connect the process. That's the reason for the retry loop here
|
||||||
DWORD new_pid = pid;
|
DWORD new_pid = pid;
|
||||||
|
|
||||||
const int retryAttempts = 10;
|
|
||||||
for (int retry = 0; retry < retryAttempts && pid == new_pid; retry++)
|
|
||||||
{
|
|
||||||
EnumChildWindows(
|
EnumChildWindows(
|
||||||
window, [](HWND hwnd, LPARAM param) -> BOOL {
|
window, [](HWND hwnd, LPARAM param) -> BOOL {
|
||||||
auto new_pid_ptr = reinterpret_cast<DWORD*>(param);
|
auto new_pid_ptr = reinterpret_cast<DWORD*>(param);
|
||||||
@@ -67,9 +64,6 @@ inline std::wstring get_process_path(HWND window) noexcept
|
|||||||
{
|
{
|
||||||
return get_process_path(new_pid);
|
return get_process_path(new_pid);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(100));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
Reference in New Issue
Block a user