Parse command line string Resulting param Profile action
| 86 | /// <param name="param">Resulting param</param> |
| 87 | /// <returns>Profile action</returns> |
| 88 | MainDlg::StartAction ParseCmdLine( std::wstring& param ) |
| 89 | { |
| 90 | int argc = 0; |
| 91 | auto pCmdLine = GetCommandLineW(); |
| 92 | auto argv = CommandLineToArgvW( pCmdLine, &argc ); |
| 93 | |
| 94 | for (int i = 1; i < argc; i++) |
| 95 | { |
| 96 | if (_wcsicmp( argv[i], L"--load" ) == 0 && i + 1 < argc) |
| 97 | { |
| 98 | param = argv[i + 1]; |
| 99 | return MainDlg::LoadProfile; |
| 100 | } |
| 101 | if (_wcsicmp( argv[i], L"--run" ) == 0 && i + 1 < argc) |
| 102 | { |
| 103 | param = argv[i + 1]; |
| 104 | return MainDlg::RunProfile; |
| 105 | } |
| 106 | } |
| 107 | |
| 108 | return MainDlg::Nothing; |
| 109 | } |
| 110 | |
| 111 | int APIENTRY wWinMain( HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPWSTR /*lpCmdLine*/, int /*nCmdShow*/ ) |
| 112 | { |