1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
|
std::ifstream ifs;
std::wstring str;
std::wstring str2 = L"-finish";
str = GetCommandLineW();
size_t found;
found = str.find(str2);
MessageBoxW(NULL, GetCommandLineW(), NULL, MB_OK);
if (found != std::wstring::npos)
{
ifs.open("E:\\StateFile.txt", std::ios_base::trunc);
if (ifs.is_open())
{
MessageBoxA(hwnd, "StateFile Opened", "Information", MB_OK);
std::string line1;
std::getline(ifs, line1);
std::stringstream line1stream(line1);
line1stream.str("\n");
int rsa;
line1stream >> rsa;
if (rsa == 1){
RSAFlag.State = Checked;
MessageBox(hwnd, "RSA Checked", NULL, MB_OK);
}else if(rsa == 2){
RSAFlag.State = Installed;
}
std::string line2;
std::getline(ifs, line2);
std::stringstream line2stream(line2);
line2stream.str("\n");
int chrome;
line2stream >> chrome;
if (chrome == 1){
CHROMEFlag.State = Checked;
MessageBox(hwnd, "Chrome Checked", NULL, MB_OK);
}else if(chrome == 2){
CHROMEFlag.State = Installed;
}
std::string line3;
std::getline(ifs, line3);
std::stringstream line3stream(line3);
line1stream.str("\n");
int skype;
line3stream >> skype;
if (skype == 1){
SKYPEFlag.State = Checked;
MessageBox(hwnd, "Skype Checked", NULL, MB_OK);
}else if(skype == 2){
SKYPEFlag.State = Installed;
}
}
else
MessageBoxA(hwnd, "StateFile could not be opened", "Error", MB_ICONERROR);
}
| |