Skip to content

Commit

Permalink
Fix: Fixed issue where FilesLauncher ignored the startup settings (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
hishitetsu committed Mar 16, 2023
1 parent c751de9 commit 30a11c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
Binary file modified src/Files.App/Assets/FilesOpenDialog/FilesLauncher.exe
Binary file not shown.
5 changes: 2 additions & 3 deletions src/Files.OpenDialog/FilesLauncher/FilesLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
LPWSTR* szArglist = CommandLineToArgvW(GetCommandLine(), &numArgs);
WCHAR openDirectory[MAX_PATH];

if (numArgs > 1)
if (numArgs > 1 && wcsnlen(szArglist[1], 1))
{
swprintf(openDirectory, _countof(openDirectory) - 1, L"%s", szArglist[1]);
std::wcout << openDirectory << std::endl;
Expand Down Expand Up @@ -199,8 +199,7 @@ int WINAPI WinMain(HINSTANCE hInstance,
SHELLEXECUTEINFO ShExecInfo = { 0 };
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = SEE_MASK_NOASYNC | SEE_MASK_FLAG_NO_UI;
ShExecInfo.lpFile = L"files-uwp:?cmd=";
ShExecInfo.lpDirectory = openDirectory;
ShExecInfo.lpFile = L"files-uwp:";
ShExecInfo.nShow = SW_SHOW;

if (!ShellExecuteEx(&ShExecInfo))
Expand Down

0 comments on commit 30a11c7

Please sign in to comment.