remove whats this button on dialogs

This commit is contained in:
Akash Mozumdar 2018-11-04 04:31:49 -05:00
parent ff44cc5f0c
commit 43a0bac59f
3 changed files with 19 additions and 5 deletions

View File

@ -179,7 +179,7 @@ void MainWindow::on_attachButton_clicked()
QStringList processList(allProcesses.uniqueKeys()); QStringList processList(allProcesses.uniqueKeys());
processList.sort(Qt::CaseInsensitive); processList.sort(Qt::CaseInsensitive);
bool ok; bool ok;
QString process = QInputDialog::getItem(this, SELECT_PROCESS, INJECT_INFO, processList, 0, true, &ok); QString process = QInputDialog::getItem(this, SELECT_PROCESS, INJECT_INFO, processList, 0, true, &ok, Qt::WindowCloseButtonHint);
if (!ok) return; if (!ok) return;
if (process.toInt(nullptr, 0)) Host::InjectProcess(process.toInt(nullptr, 0)); if (process.toInt(nullptr, 0)) Host::InjectProcess(process.toInt(nullptr, 0));
else for (auto processId : allProcesses.values(process)) Host::InjectProcess(processId); else for (auto processId : allProcesses.values(process)) Host::InjectProcess(processId);
@ -193,7 +193,7 @@ void MainWindow::on_detachButton_clicked()
void MainWindow::on_hookButton_clicked() void MainWindow::on_hookButton_clicked()
{ {
bool ok; bool ok;
QString hookCode = QInputDialog::getText(this, ADD_HOOK, CODE_INFODUMP, QLineEdit::Normal, "", &ok); QString hookCode = QInputDialog::getText(this, ADD_HOOK, CODE_INFODUMP, QLineEdit::Normal, "", &ok, Qt::WindowCloseButtonHint);
if (!ok) return; if (!ok) return;
if (auto hp = ParseCode(hookCode)) Host::InsertHook(GetSelectedProcessId(), hp.value()); if (auto hp = ParseCode(hookCode)) Host::InsertHook(GetSelectedProcessId(), hp.value());
else Host::AddConsoleOutput(INVALID_CODE); else Host::AddConsoleOutput(INVALID_CODE);
@ -211,7 +211,7 @@ void MainWindow::on_unhookButton_clicked()
GenerateCode(hook, GetSelectedProcessId()) GenerateCode(hook, GetSelectedProcessId())
); );
bool ok; bool ok;
QString hook = QInputDialog::getItem(this, UNHOOK, REMOVE_HOOK, hookList, 0, false, &ok); QString hook = QInputDialog::getItem(this, UNHOOK, REMOVE_HOOK, hookList, 0, false, &ok, Qt::WindowCloseButtonHint);
if (ok) Host::RemoveHook(GetSelectedProcessId(), hooks.at(hookList.indexOf(hook)).insertion_address); if (ok) Host::RemoveHook(GetSelectedProcessId(), hooks.at(hookList.indexOf(hook)).insertion_address);
} }

View File

@ -66,7 +66,14 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved
{ {
QTimer::singleShot(0, [] QTimer::singleShot(0, []
{ {
translateTo = QInputDialog::getItem(nullptr, "Select Language", "What language should Bing translate to?", languages, 0, false).split(" ")[1].toStdWString(); translateTo = QInputDialog::getItem(
nullptr,
"Select Language",
"What language should Bing translate to?",
languages,
0, false, nullptr,
Qt::WindowCloseButtonHint
).split(" ")[1].toStdWString();
}); });
} }
break; break;

View File

@ -82,7 +82,14 @@ BOOL WINAPI DllMain(HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved
{ {
QTimer::singleShot(0, [] QTimer::singleShot(0, []
{ {
translateTo = QInputDialog::getItem(nullptr, "Select Language", "What language should Google translate to?", languages, 0, false).split(" ")[1].toStdWString(); translateTo = QInputDialog::getItem(
nullptr,
"Select Language",
"What language should Google translate to?",
languages,
0, false, nullptr,
Qt::WindowCloseButtonHint
).split(" ")[1].toStdWString();
}); });
} }
break; break;