I could use system(variable); and everything would be all good, except for the cmd box that pops up with it.
I could use ShellExecute with some of them working (as long as i removed beginning and trailing quotes), and having the programs mem usage jump from about 4,000K to 6,000K and try to figure out how to get the rest to work
or I could use CreateProcess, which doesnt change mem usage that much (which is why i was wanting to use it) but for all entries brings up "The application failed to initialize properly (0xc0000005)". (0xc0000005) is an access violation memory error. This is actually quite weird since just a day or two ago, CreateProcess was acting more like what ShellExecute was doing. Don't ask me what I had when this was happening...I have changed much of my code since then, but the below is basically what I had to execute it.
Code:
void StartProcess(char* szExe)
{
STARTUPINFO startupInfo;
PROCESS_INFORMATION processInfo;
ZeroMemory( &startupInfo, sizeof(processInfo) );
startupInfo.cb = sizeof(startupInfo);
ZeroMemory( &processInfo, sizeof(processInfo) );
if (CreateProcess(0, szExe, 0, 0, FALSE, 0, 0, 0, &startupInfo, &processInfo))
{
WaitForSingleObject( processInfo.hProcess, INFINITE );
}
else
{
MessageBox(NULL, szExe, "", MB_OK); //just using this to see what shows and doesnt show...will change eventually.
}
CloseHandle( processInfo.hProcess );
CloseHandle( processInfo.hThread );
}
So, I could try to use ShellExecute, but then I would have to figure out a way to parse every single known format, but because people have their different preferences it would almost be endless, in my opinion
or if there was a way to do something like system() but without the console application box..then that would be awesome...
Bookmarks