GUIで引数付きで起動してもファイルパスが設定されないことがあるのを修正

This commit is contained in:
lltcggie 2016-05-07 07:59:08 +09:00
parent 711810b985
commit c522af6275

View File

@ -1835,36 +1835,35 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData)
SetDepthAndQuality(false); SetDepthAndQuality(false);
if (isArgStartAuto) // 引数指定されたら自動で実行(フラグ設定時のみ) int nArgs = 0;
LPTSTR *lplpszArgs;
lplpszArgs = CommandLineToArgvW(GetCommandLine(), &nArgs);
if (lplpszArgs)
{ {
int nArgs = 0; input_str_multi.clear();
LPTSTR *lplpszArgs;
lplpszArgs = CommandLineToArgvW(GetCommandLine(), &nArgs); if (nArgs > 1)
if (lplpszArgs)
{ {
input_str_multi.clear(); if (nArgs == 2)
if (nArgs > 1)
{ {
if (nArgs == 2) OnSetInputFilePath(lplpszArgs[1]);
{ }
OnSetInputFilePath(lplpszArgs[1]); else if (nArgs > 2)
} {
else if (nArgs > 2) for (int i = 1; i < nArgs; i++)
{ input_str_multi.push_back(lplpszArgs[i]);
for (int i = 1; i < nArgs; i++)
input_str_multi.push_back(lplpszArgs[i]);
OnSetInputFilePath(); OnSetInputFilePath();
}
isCommandLineStart = true;
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
} }
LocalFree(lplpszArgs); if (isArgStartAuto) // 引数指定されたら自動で実行(フラグ設定時のみ)
{
isCommandLineStart = true;
::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0);
}
} }
LocalFree(lplpszArgs);
} }
} }