Skip to content

Commit

Permalink
small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Artikash committed Nov 19, 2018
1 parent 95ca747 commit 902ded6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
10 changes: 2 additions & 8 deletions GUI/host/host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ namespace
break;
default:
{
ThreadParam tp = *(ThreadParam*)buffer;
buffer[bytesRead] = 0;
buffer[bytesRead + 1] = 0;
auto tp = *(ThreadParam*)buffer;
DispatchText(tp, buffer + sizeof(tp), bytesRead - sizeof(tp));
}
break;
Expand Down Expand Up @@ -163,14 +161,10 @@ namespace
{
std::thread([]
{
std::wstring last;
while (true)
{
Sleep(50);
for (std::wstring last; true; Sleep(50))
if (auto text = GetClipboardText())
if (last != text.value())
Host::GetThread(CLIPBOARD)->AddSentence(last = text.value());
}
}).detach();
}
}
Expand Down
2 changes: 1 addition & 1 deletion GUI/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ void MainWindow::on_attachButton_clicked()
QStringList processList(allProcesses.uniqueKeys());
processList.sort(Qt::CaseInsensitive);
bool ok;
QString process = QInputDialog::getItem(this, SELECT_PROCESS, INJECT_INFO, processList, 0, true, &ok, Qt::WindowCloseButtonHint);
QString process = QInputDialog::getItem(this, SELECT_PROCESS, ATTACH_INFO, processList, 0, true, &ok, Qt::WindowCloseButtonHint);
if (!ok) return;
if (process.toInt(nullptr, 0)) Host::InjectProcess(process.toInt(nullptr, 0));
else for (auto processId : allProcesses.values(process)) Host::InjectProcess(processId);
Expand Down
9 changes: 6 additions & 3 deletions include/text.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once

constexpr auto SELECT_PROCESS = u8"Select Process";
constexpr auto INJECT_INFO = u8"If you don't see the process you want to inject, try running with admin rights\r\n"
constexpr auto ATTACH_INFO = u8"If you don't see the process you want to attach, try running with admin rights\r\n"
"You can also type in the process id";
constexpr auto ADD_HOOK = u8"Add hook";
constexpr auto CODE_INFODUMP = u8"Enter hook code\r\n"
Expand All @@ -20,8 +20,11 @@ constexpr auto UNHOOK = u8"Unhook";
constexpr auto REMOVE_HOOK = u8"Which hook to remove?";
constexpr auto SELECT_EXTENSION = u8"Select Extension";
constexpr auto EXTENSIONS = u8"Extensions (*.dll)";
constexpr auto ABOUT = L"Textractor beta v3.4.1 by Artikash\r\n"
"Source code and more information available under GPLv3 at https://github.com/Artikash/Textractor";
constexpr auto ABOUT = L"Textractor beta v3.5.0 (project homepage: https://github.com/Artikash/Textractor)\r\n"
"Made with <3 by Artikash (email: akashmozumdar@gmail.com)\r\n"
"Please contact Artikash with any problems, feature requests, or questions relating to Textractor\r\n"
"You can do so via the project homepage (issues section) or via email\r\n"
"Source code available under GPLv3 at project homepage";
constexpr auto TOO_MANY_THREADS = L"Textractor: too many text threads: can't create more";
constexpr auto ALREADY_INJECTED = L"Textractor: already injected";
constexpr auto ARCHITECTURE_MISMATCH = L"Textractor: architecture mismatch: try 32 bit Textractor instead";
Expand Down

0 comments on commit 902ded6

Please sign in to comment.