fix AddForce and AddOpen

This commit is contained in:
offhub 2024-07-22 01:30:07 +03:00
parent 33840542c1
commit 238810bd75
No known key found for this signature in database
GPG Key ID: 7B12A8941851DA59
2 changed files with 4 additions and 4 deletions

View File

@ -1643,10 +1643,10 @@ void CSandMan::OnMessage(const QString& MsgData)
{
if (theAPI->GetBoxByName(response) != NULL) {
if (Message.right(1)=="\\"||!Message.contains(".", Qt::CaseInsensitive)) {
theAPI->GetBoxByName(response)->AppendText("ForceFolder", Message.mid(4).replace("\"",""));
theAPI->GetBoxByName(response)->AppendText("ForceFolder", Message.mid(9).replace("\"",""));
}
else {
theAPI->GetBoxByName(response)->AppendText("ForceProcess", Message.mid(4).replace("\"", "").mid(Message.mid(4).replace("\"", "").lastIndexOf("\\")+1));
theAPI->GetBoxByName(response)->AppendText("ForceProcess", Message.mid(9).replace("\"", "").mid(Message.mid(4).replace("\"", "").lastIndexOf("\\")+1));
}
}
@ -1664,7 +1664,7 @@ void CSandMan::OnMessage(const QString& MsgData)
if (!response.isEmpty())
{
if (theAPI->GetBoxByName(response) != NULL) {
theAPI->GetBoxByName(response)->AppendText("OpenFilePath", Message.mid(4).replace("\"", ""));
theAPI->GetBoxByName(response)->AppendText("OpenFilePath", Message.mid(8).replace("\"", ""));
}
else {
QMessageBox::warning(g_GUIParent, tr("Sandboxie-Plus Warning"), tr("You typed a wrong box name!Nothing was changed."), QMessageBox::Ok, 0);

View File

@ -180,7 +180,7 @@ int main(int argc, char *argv[])
if (AOPos != -1) {
LPWSTR cmdLine0 = wcsstr(GetCommandLineW(), L"/add_open");
if (!cmdLine0) return -1;
LPWSTR cmdLine = cmdLine0 + 10;
LPWSTR cmdLine = cmdLine0 + 9;
g_PendingMessage = "AddOpen:" + QString::fromWCharArray(cmdLine + 1);
}