Skip to content

Commit

Permalink
Fix Runner stealing shortcuts on older Win10 (#9744)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan100sic committed Feb 17, 2021
1 parent 666b4e5 commit ee45c39
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/modules/launcher/Microsoft.Launcher/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,16 @@ class Microsoft_Launcher : public PowertoyModuleIface
sei.lpFile = L"modules\\launcher\\PowerLauncher.exe";
sei.nShow = SW_SHOWNORMAL;
sei.lpParameters = executable_args.data();
ShellExecuteExW(&sei);

m_hProcess = sei.hProcess;

if (ShellExecuteExW(&sei))
{
m_enabled = true;
m_hProcess = sei.hProcess;
}
else
{
Logger::error("Launcher failed to start");
}
}
else
{
Expand All @@ -231,6 +238,7 @@ class Microsoft_Launcher : public PowertoyModuleIface

if (run_non_elevated(action_runner_path, params, pidBuffer))
{
m_enabled = true;
const int maxRetries = 80;
for (int retry = 0; retry < maxRetries; ++retry)
{
Expand All @@ -248,8 +256,6 @@ class Microsoft_Launcher : public PowertoyModuleIface
}
}
}

m_enabled = true;
}

// Disable the powertoy
Expand Down

0 comments on commit ee45c39

Please sign in to comment.