Enable hiding OSK on Windows

preferencesAboutTextFull
Craig Watson 8 years ago
parent 214764dce3
commit a8d94208b9
  1. 22
      src/frameworks/UBPlatformUtils_win.cpp

@ -439,11 +439,19 @@ void UBPlatformUtils::showFullScreen(QWidget *pWidget)
void UBPlatformUtils::showOSK(bool show)
{
Q_UNUSED(show);
QString windir = qgetenv("WINDIR");
QString osk_path = windir+"\\System32\\osk.exe";
QProcess newProcess;
newProcess.startDetached("explorer.exe", QStringList() << osk_path);
if (show) {
QString windir = qgetenv("WINDIR");
QString osk_path = windir+"\\System32\\osk.exe";
QProcess oskProcess;
// We have to pass by explorer.exe because osk.exe can only be launched
// directly with administrator rights
oskProcess.startDetached("explorer.exe", QStringList() << osk_path);
}
else {
HWND oskWindow = ::FindWindow(TEXT("OSKMainClass"), NULL);
if (oskWindow)
PostMessage(oskWindow, WM_SYSCOMMAND, SC_CLOSE, 0);
}
}

Loading…
Cancel
Save