I'm trying to open a picture using WinApi in c++, tried both createProcessW and createProcessA, my main problem was concatenating the strings that are used as cmdLine parameter. this is what iv'e got:
STARTUPINFOW process_startup_info{ 0 };
process_startup_info.cb = sizeof(process_startup_info); // setup size of strcture in bytes
PROCESS_INFORMATION process_info{ 0 };
wchar_t* s = L"\"C:\\Windows\\system32\\mspaint.exe\" ";
std::string s2 = pic.getPath();
// connecting strings here
if (CreateProcessW(NULL, /* string should be here */, NULL, NULL, TRUE, 0, NULL, NULL, &process_startup_info, &process_info))
{
WaitForSingleObject(process_info.hProcess, INFINITE);
CloseHandle(process_info.hProcess);
CloseHandle(process_info.hThread);
}