diff --git a/main.c b/main.c index 2f7f485..649a9c8 100644 --- a/main.c +++ b/main.c @@ -1,31 +1,27 @@ #include #include -wchar_t wd[255], program[255], args[255]; - -int wmain(int argc, wchar_t *argv[], wchar_t *argv2[]) +int wmain(int argc, wchar_t **argv, wchar_t **argv2) { if (argc > 1) { - ShellExecuteW(NULL, L"runas", argv[1], argv[2], NULL, SW_RESTORE); + ShellExecuteW(NULL, L"runas", argv[1], argv[2], NULL, SW_SHOW); } - if (argc < 2) + else { - system("title SimpleRunBox"); + system("title SimpleRunBox"); wchar_t wd[255], program[255], args[255]; wprintf(L"Enter path to the program\n"); _getws(program); system("cls"); - wprintf(L"Enter what do (for example: open, runas)\n"); + wprintf(L"Enter operation (default is open)\n"); _getws(wd); system("cls"); wprintf(L"Enter arguments\n"); _getws(args); system("cls"); - wprintf(L"Summary:\n"); - wprintf(L"Program: %ls\n", program); - wprintf(L"What do with the program: %ls\n", wd); - wprintf(L"Arguments: %ls\n", args); - system("pause"); - ShellExecuteW(NULL, wd, program, args, NULL, SW_RESTORE); + wprintf(L"Summary:\nProgram: %ls\nWhat do with the program: %ls\nArguments: %ls\n", program, wd, args); + wprintf(L"\nPress any key if everything seems right"); getchar(); + ShellExecuteW(NULL, wd, program, args, NULL, SW_SHOW); + return 0; } }