From 199d132eb713d0bfbff59c4ae5a1ff9d0ac19dea Mon Sep 17 00:00:00 2001 From: lordmulder Date: Sat, 29 Jan 2011 21:57:53 +0100 Subject: [PATCH] Fixed Windows XP compatibility. RegSetKeyValue() isn't supported on system prior to Vista. --- src/Config.h | 2 +- src/Dialog_About.cpp | 9 ++++++++- src/Dialog_MainWindow.cpp | 7 ++++++- src/ShellIntegration.cpp | 4 ++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/Config.h b/src/Config.h index 03499a4a..7c981536 100644 --- a/src/Config.h +++ b/src/Config.h @@ -25,7 +25,7 @@ #define VER_LAMEXP_MAJOR 4 #define VER_LAMEXP_MINOR_HI 0 #define VER_LAMEXP_MINOR_LO 0 -#define VER_LAMEXP_BUILD 276 +#define VER_LAMEXP_BUILD 277 #define VER_LAMEXP_SUFFIX Beta-2 /* diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index 71b15d0a..b86908ff 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -157,7 +157,14 @@ int AboutDialog::exec() { if(m_settings->soundsEnabled()) { - if(!m_firstShow || !playResoureSound("imageres.dll", 5080, true)) + if(m_firstShow) + { + if(!playResoureSound("imageres.dll", 5080, true)) + { + PlaySound(TEXT("SystemStart"), NULL, SND_ALIAS | SND_ASYNC); + } + } + else { PlaySound(MAKEINTRESOURCE(IDR_WAVE_ABOUT), GetModuleHandle(NULL), SND_RESOURCE | SND_ASYNC); } diff --git a/src/Dialog_MainWindow.cpp b/src/Dialog_MainWindow.cpp index 32cd2efc..58eaa5f3 100644 --- a/src/Dialog_MainWindow.cpp +++ b/src/Dialog_MainWindow.cpp @@ -295,7 +295,7 @@ MainWindow::MainWindow(FileListModel *fileListModel, AudioFileModel *metaInfo, S actionDisableNeroAacNotifications->setChecked(!m_settings->neroAacNotificationsEnabled()); actionDisableWmaDecoderNotifications->setChecked(!m_settings->wmaDecoderNotificationsEnabled()); actionDisableShellIntegration->setChecked(!m_settings->shellIntegrationEnabled()); - actionDisableShellIntegration->setVisible(!lamexp_portable_mode()); + actionDisableShellIntegration->setDisabled(lamexp_portable_mode() && actionDisableShellIntegration->isChecked()); connect(actionDisableUpdateReminder, SIGNAL(triggered(bool)), this, SLOT(disableUpdateReminderActionTriggered(bool))); connect(actionDisableSounds, SIGNAL(triggered(bool)), this, SLOT(disableSoundsActionTriggered(bool))); connect(actionInstallWMADecoder, SIGNAL(triggered(bool)), this, SLOT(installWMADecoderActionTriggered(bool))); @@ -2164,4 +2164,9 @@ void MainWindow::disableShellIntegrationActionTriggered(bool checked) } actionDisableShellIntegration->setChecked(!m_settings->shellIntegrationEnabled()); + + if(lamexp_portable_mode() && actionDisableShellIntegration->isChecked()) + { + actionDisableShellIntegration->setEnabled(false); + } } diff --git a/src/ShellIntegration.cpp b/src/ShellIntegration.cpp index 30cfabef..e02583e5 100644 --- a/src/ShellIntegration.cpp +++ b/src/ShellIntegration.cpp @@ -44,7 +44,7 @@ static const char *g_lamexpFileType = "LameXP.SupportedAudioFile"; QMutex ShellIntegration::m_mutex; //Macros -#define REG_WRITE_STRING(KEY, STR) RegSetKeyValue(key, NULL, NULL, REG_SZ, QWCHAR(STR), (STR.size() + 1) * sizeof(wchar_t)) +#define REG_WRITE_STRING(KEY, STR) RegSetValueEx(key, NULL, NULL, REG_SZ, reinterpret_cast(STR.utf16()), (STR.size() + 1) * sizeof(wchar_t)) //////////////////////////////////////////////////////////// // Constructor @@ -247,7 +247,7 @@ QStringList *ShellIntegration::detectTypes(const QString &lamexpFileType, const { if(RegCreateKeyEx(HKEY_CURRENT_USER, QWCHAR(QString("Software\\Classes\\%1").arg(currentExt)), NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &key, NULL) == ERROR_SUCCESS) { - RegSetKeyValue(key, NULL, NULL, REG_SZ, QWCHAR(lamexpFileType), (lamexpFileType.size() + 1) * sizeof(wchar_t)); + REG_WRITE_STRING(key, lamexpFileType); RegCloseKey(key); } }