From c522af62751827398a4ef560a3f3cf18edd12efd Mon Sep 17 00:00:00 2001 From: lltcggie Date: Sat, 7 May 2016 07:59:08 +0900 Subject: [PATCH] =?UTF-8?q?GUI=E3=81=A7=E5=BC=95=E6=95=B0=E4=BB=98?= =?UTF-8?q?=E3=81=8D=E3=81=A7=E8=B5=B7=E5=8B=95=E3=81=97=E3=81=A6=E3=82=82?= =?UTF-8?q?=E3=83=95=E3=82=A1=E3=82=A4=E3=83=AB=E3=83=91=E3=82=B9=E3=81=8C?= =?UTF-8?q?=E8=A8=AD=E5=AE=9A=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E3=81=93?= =?UTF-8?q?=E3=81=A8=E3=81=8C=E3=81=82=E3=82=8B=E3=81=AE=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- waifu2x-caffe-gui/MainDialog.cpp | 45 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/waifu2x-caffe-gui/MainDialog.cpp b/waifu2x-caffe-gui/MainDialog.cpp index 21d8e3c..9febba1 100644 --- a/waifu2x-caffe-gui/MainDialog.cpp +++ b/waifu2x-caffe-gui/MainDialog.cpp @@ -1835,36 +1835,35 @@ void DialogEvent::Create(HWND hWnd, WPARAM wParam, LPARAM lParam, LPVOID lpData) SetDepthAndQuality(false); - if (isArgStartAuto) // 引数指定されたら自動で実行(フラグ設定時のみ) + int nArgs = 0; + LPTSTR *lplpszArgs; + lplpszArgs = CommandLineToArgvW(GetCommandLine(), &nArgs); + if (lplpszArgs) { - int nArgs = 0; - LPTSTR *lplpszArgs; - lplpszArgs = CommandLineToArgvW(GetCommandLine(), &nArgs); - if (lplpszArgs) + input_str_multi.clear(); + + if (nArgs > 1) { - input_str_multi.clear(); - - if (nArgs > 1) + if (nArgs == 2) { - if (nArgs == 2) - { - OnSetInputFilePath(lplpszArgs[1]); - } - else if (nArgs > 2) - { - for (int i = 1; i < nArgs; i++) - input_str_multi.push_back(lplpszArgs[i]); + OnSetInputFilePath(lplpszArgs[1]); + } + else if (nArgs > 2) + { + for (int i = 1; i < nArgs; i++) + input_str_multi.push_back(lplpszArgs[i]); - OnSetInputFilePath(); - } - - isCommandLineStart = true; - - ::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0); + OnSetInputFilePath(); } - LocalFree(lplpszArgs); + if (isArgStartAuto) // 引数指定されたら自動で実行(フラグ設定時のみ) + { + isCommandLineStart = true; + ::PostMessage(GetDlgItem(dh, IDC_BUTTON_EXEC), BM_CLICK, 0, 0); + } } + + LocalFree(lplpszArgs); } }