5 #include <QApplication>
6 #define WIN32_LEAN_AND_MEAN
7 #include <qt_windows.h>
9 void MusicPlatformManager::windowsEnableLeftMode()
12 memset(input, 0,
sizeof(input));
13 input[0].type = input[1].type = input[2].type = input[3].type = INPUT_KEYBOARD;
14 input[0].ki.wVk = input[2].ki.wVk = VK_LWIN;
15 input[1].ki.wVk = input[3].ki.wVk = 0x44;
16 input[2].ki.dwFlags = input[3].ki.dwFlags = KEYEVENTF_KEYUP;
17 SendInput(4, input,
sizeof(INPUT));
20 int MusicPlatformManager::windowsIEVersion()
const
22 const DWORD versionInfoSize = GetFileVersionInfoSizeW(L
"mshtml.dll",
nullptr);
23 if(versionInfoSize == 0)
28 BYTE *data =
new BYTE[versionInfoSize];
29 if(!GetFileVersionInfoW(L
"mshtml.dll", 0, versionInfoSize, data))
35 const VS_FIXEDFILEINFO *fixedFileInfo =
nullptr;
36 UINT fixedFileInfoSize = 0;
37 if(!VerQueryValueW(data, L
"\\", (LPVOID*)&fixedFileInfo, &fixedFileInfoSize))
44 return HIWORD(fixedFileInfo->dwProductVersionMS);
47 void MusicPlatformManager::windowsStartUpMode(
bool v)
const
53 QSettings reg(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
54 QSettings regWOW(
"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
58 if(reg.value(appName).toString() != appPath)
60 reg.setValue(appName, QString(
"\"%1\"").arg(appPath));
63 if(regWOW.value(appName).toString() != appPath)
65 regWOW.setValue(appName, QString(
"\"%1\"").arg(appPath));
70 if(reg.contains(appName))
76 if(regWOW.contains(appName))
78 regWOW.remove(appName);