forked from Public-Mirror/Textractor
improve UX
This commit is contained in:
parent
b290392034
commit
34acf4f300
@ -175,10 +175,10 @@ void MainWindow::on_attachButton_clicked()
|
|||||||
{
|
{
|
||||||
bool ok;
|
bool ok;
|
||||||
QString process = QInputDialog::getItem(this, "Select Process",
|
QString process = QInputDialog::getItem(this, "Select Process",
|
||||||
"If you don't see the process you want to inject, try running with admin rights",
|
"If you don't see the process you want to inject, try running with admin rights\r\nYou can also just type in the process id if you know it",
|
||||||
GetAllProcesses(), 0, true, &ok);
|
GetAllProcesses(), 0, true, &ok);
|
||||||
if (!ok) return;
|
if (!ok) return;
|
||||||
if (!Host::InjectProcess(process.split(":")[1].toInt())) Host::AddConsoleOutput(L"Failed to attach");
|
if (!Host::InjectProcess(process.split(":")[0].toInt())) Host::AddConsoleOutput(L"Failed to attach");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_detachButton_clicked()
|
void MainWindow::on_detachButton_clicked()
|
||||||
|
@ -27,8 +27,10 @@ QStringList GetAllProcesses()
|
|||||||
if (!EnumProcesses(allProcessIds, sizeof(allProcessIds), &spaceUsed)) return ret;
|
if (!EnumProcesses(allProcessIds, sizeof(allProcessIds), &spaceUsed)) return ret;
|
||||||
for (int i = 0; i < spaceUsed / sizeof(DWORD); ++i)
|
for (int i = 0; i < spaceUsed / sizeof(DWORD); ++i)
|
||||||
if (GetModuleName(allProcessIds[i]).size())
|
if (GetModuleName(allProcessIds[i]).size())
|
||||||
ret.push_back(GetModuleName(allProcessIds[i]) + ": " + QString::number(allProcessIds[i]));
|
ret.push_back(GetModuleName(allProcessIds[i]) + ":" + QString::number(allProcessIds[i]));
|
||||||
ret.sort();
|
ret.sort(Qt::CaseInsensitive);
|
||||||
|
for (int i = 0; i < ret.size(); ++i)
|
||||||
|
ret[i] = ret[i].split(":")[1] + ": " + ret[i].split(":")[0];
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user